Skip to content

Commit

Permalink
Merge pull request openshift#1805 from deads2k/by-gate-18-payload-names
Browse files Browse the repository at this point in the history
make featuregate manifest pattern consistent and remove legacy files
  • Loading branch information
openshift-merge-bot[bot] committed Mar 14, 2024
2 parents bcf33ad + 676fb69 commit 4caef7f
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 387 deletions.
22 changes: 2 additions & 20 deletions payload-command/render/write_featureset.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,15 @@ func (o *WriteFeatureSets) Run() error {
}

featureGateOutBytes := writeFeatureGateV1OrDie(featureGateInstance)
featureSetFileName := fmt.Sprintf("featureGate-%s-%s.yaml", featureSetName, clusterProfileToShortName[clusterProfile])
featureSetFileName := fmt.Sprintf("featureGate-%s-%s.yaml", clusterProfileToShortName[clusterProfile], featureSetName)
if len(featureSetName) == 0 {
featureSetFileName = fmt.Sprintf("featureGate-%s-%s.yaml", "Default", clusterProfileToShortName[clusterProfile])
featureSetFileName = fmt.Sprintf("featureGate-%s-%s.yaml", clusterProfileToShortName[clusterProfile], "Default")
}

destFile := filepath.Join(o.AssetOutputDir, featureSetFileName)
if err := os.WriteFile(destFile, []byte(featureGateOutBytes), 0644); err != nil {
return fmt.Errorf("error writing FeatureGate manifest: %w", err)
}

// for compatibility during the transition, we'll copy the old, invalid featuregates
legacyFilename := ""
switch {
case len(featureSetName) == 0 && clusterProfile == configv1.SelfManaged:
legacyFilename = "featureGate-Default.yaml"
case featureSetName == configv1.TechPreviewNoUpgrade && clusterProfile == configv1.SelfManaged:
legacyFilename = "featureGate-TechPreviewNoUpgrade.yaml"
}
if len(legacyFilename) > 0 {
legacyFeatureGateInstance := featureGateInstance.DeepCopy()
delete(legacyFeatureGateInstance.Annotations, "include.release.openshift.io/self-managed-high-availability")
legacyFeatureGateBytes := writeFeatureGateV1OrDie(legacyFeatureGateInstance)
legacyFile := filepath.Join(o.AssetOutputDir, legacyFilename)
if err := os.WriteFile(legacyFile, []byte(legacyFeatureGateBytes), 0644); err != nil {
return fmt.Errorf("error writing FeatureGate manifest: %w", err)
}
}
}
}

Expand Down
182 changes: 0 additions & 182 deletions payload-manifests/featuregates/featureGate-Default.yaml

This file was deleted.

0 comments on commit 4caef7f

Please sign in to comment.