Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lca: cnf exclude operators and sriov nnp from post validation checks #56

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ type ClusterStruct struct {
}

// SaveClusterInfo is a dedicated func to save cluster info.
//
//nolint:funlen
func (upgradeVar *ClusterStruct) SaveClusterInfo() error {
clusterVersion, err := cluster.GetOCPClusterVersion(cnfinittools.TargetSNOAPIClient)

Expand Down Expand Up @@ -88,7 +90,11 @@ func (upgradeVar *ClusterStruct) SaveClusterInfo() error {

for _, csv := range csvList {
if !slices.Contains(installedCSV, csv.Object.Name) {
installedCSV = append(installedCSV, csv.Object.Name)
if !strings.Contains(csv.Object.Name, "oadp-operator") &&
!strings.Contains(csv.Object.Name, "packageserver") &&
!strings.Contains(csv.Object.Name, "sriov-fec") {
installedCSV = append(installedCSV, csv.Object.Name)
}
}
}

Expand Down Expand Up @@ -116,7 +122,9 @@ func (upgradeVar *ClusterStruct) SaveClusterInfo() error {
sriovPolicy, err := sriov.ListPolicy(cnfinittools.TargetSNOAPIClient, cnfinittools.CNFConfig.SriovOperatorNamespace)

for _, policy := range sriovPolicy {
upgradeVar.SriovNetworkNodePolicies = append(upgradeVar.SriovNetworkNodePolicies, policy.Object.Name)
if !strings.Contains(policy.Object.Name, "default") {
upgradeVar.SriovNetworkNodePolicies = append(upgradeVar.SriovNetworkNodePolicies, policy.Object.Name)
}
}

upgradeVar.Version = clusterVersion.Object.Status.Desired.Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func ValidateSeedHostnameRefEtcd() {

etcdCmd := fmt.Sprintf(
"for key in $(etcdctl get --prefix / --keys-only | grep -v ^$); do"+
" value=$(etcdctl get --print-value-only $key); "+
" value=$(etcdctl get --print-value-only $key | tr -d '\\0'); "+
" if [[ $value == *%s* ]]; then"+
" echo Key: $key contains seed reference;"+
" break; "+
Expand Down
Loading