feat(cli): Added hash compare between current and desired manifest state without using annotation. instead the current hash is calculated from the showapp() app.deploymentmanifest field
This commit is contained in:
parent
36934e8abf
commit
d0b95d9d34
2 changed files with 6 additions and 1 deletions
|
|
@ -304,6 +304,11 @@ func (p *EdgeConnectPlanner) getCurrentAppState(ctx context.Context, desired *Ap
|
||||||
LastUpdated: time.Now(), // EdgeConnect doesn't provide this, so use current time
|
LastUpdated: time.Now(), // EdgeConnect doesn't provide this, so use current time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate current manifest hash
|
||||||
|
hasher := sha256.New()
|
||||||
|
hasher.Write([]byte(app.DeploymentManifest))
|
||||||
|
current.ManifestHash = fmt.Sprintf("%x", hasher.Sum(nil))
|
||||||
|
|
||||||
// Note: EdgeConnect API doesn't currently support annotations for manifest hash tracking
|
// Note: EdgeConnect API doesn't currently support annotations for manifest hash tracking
|
||||||
// This would be implemented when the API supports it
|
// This would be implemented when the API supports it
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ spec:
|
||||||
# image: "https://registry-1.docker.io/library/nginx:latest"
|
# image: "https://registry-1.docker.io/library/nginx:latest"
|
||||||
k8sApp:
|
k8sApp:
|
||||||
appVersion: "1.0.0"
|
appVersion: "1.0.0"
|
||||||
manifestFile: "./k8s-deployment.yaml" # store hash of the manifest file in annotation field. Annotations is a comma separated map of arbitrary key value pairs,
|
manifestFile: "./k8s-deployment.yaml"
|
||||||
infraTemplate:
|
infraTemplate:
|
||||||
- organization: "edp2"
|
- organization: "edp2"
|
||||||
region: "EU"
|
region: "EU"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue