Skip to content

Commit

Permalink
Merge pull request #243 from jkyros/migrate-mco-api
Browse files Browse the repository at this point in the history
MCO-483: generate machineconfiguration (MCO) clients as part of MCO API migration
  • Loading branch information
openshift-ci[bot] authored Oct 5, 2023
2 parents 848405d + c7f9314 commit e81400b
Show file tree
Hide file tree
Showing 299 changed files with 42,737 additions and 49 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/openshift/client-go
go 1.20

require (
github.com/openshift/api v0.0.0-20230915112357-693d4b64813c
github.com/openshift/api v0.0.0-20230929221546-73731d374fbf
github.com/openshift/build-machinery-go v0.0.0-20220913142420-e25cf57ea46d
github.com/spf13/pflag v1.0.5
k8s.io/api v0.28.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/openshift/api v0.0.0-20230915112357-693d4b64813c h1:ro/BvvpAikMoZc/fsxJN6jxmK+4uIbdNIK9nwaFQ5xo=
github.com/openshift/api v0.0.0-20230915112357-693d4b64813c/go.mod h1:NFgA+laiQtptmjsp1trDnGqjV62nYzlUfQ6P5I9oqXA=
github.com/openshift/api v0.0.0-20230929221546-73731d374fbf h1:V9YUWOXuMh8JXBbmaEJEGIBl21XLsvGSPBMgYb4rJzE=
github.com/openshift/api v0.0.0-20230929221546-73731d374fbf/go.mod h1:qNtV0315F+f8ld52TLtPvrfivZpdimOzTi3kn9IVbtU=
github.com/openshift/build-machinery-go v0.0.0-20220913142420-e25cf57ea46d h1:RR4ah7FfaPR1WePizm0jlrsbmPu91xQZnAsVVreQV1k=
github.com/openshift/build-machinery-go v0.0.0-20220913142420-e25cf57ea46d/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/kube-openapi v0.0.0-20230816122517-ffc8f001abb0 h1:GPlAy197Jkr+D0T2FNWanamraTdzS/r9ZkT29lxvHaA=
Expand Down
25 changes: 23 additions & 2 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,46 @@ function generateApplyConfiguration(){
done
done

echo "Generating applyconfigurations"
if [ "$OUTPUT_PKG" == "github.com/openshift/client-go/machineconfiguration" ]
then
# TODO(jkyros): this is a temporary hack to ensure proper generation until the MCO can sort
# out their embedded corev1.ObjectReference in MachineConfigPoolStatusConfiguration, which needs
# to be resolved by the end of release-4.15 so this hack can be removed
echo "Generating applyconfigurations specifically for MCO"
applyconfigurationgen_external_apis_csv="$(codegen::join , "${FQ_APIS[@]}")"
applyconfigurations_package="${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-applyconfigurations}"
${APPLYCONFIGURATION_GEN} \
--output-package "${applyconfigurations_package}" \
--input-dirs "${applyconfigurationgen_external_apis_csv}" \
--external-applyconfigurations k8s.io/api/core/v1.ObjectReference:k8s.io/client-go/applyconfigurations/core/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorSpec:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorStatus:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorCondition:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.GenerationStatus:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
"$@"
else
echo "Generating applyconfigurations for $OUTPUT_PKG"
applyconfigurationgen_external_apis_csv="$(codegen::join , "${FQ_APIS[@]}")"
applyconfigurations_package="${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-applyconfigurations}"
${APPLYCONFIGURATION_GEN} \
--output-package "${applyconfigurations_package}" \
--input-dirs "${applyconfigurationgen_external_apis_csv}" \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorSpec:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorStatus:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.OperatorCondition:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
--external-applyconfigurations github.com/openshift/api/operator/v1.GenerationStatus:github.com/openshift/client-go/operator/applyconfigurations/operator/v1 \
"$@"
fi


}

# Until we get https://github.com/kubernetes/kubernetes/pull/120877 merged we need to
# explicitly set these two variables which are not defaulted properly in generate-internal-groups.sh
export CLIENTSET_PKG=clientset
export CLIENTSET_NAME=versioned

for group in apiserver apps authorization build cloudnetwork image imageregistry network oauth project quota route samples security securityinternal template user; do
for group in apiserver apps authorization build cloudnetwork image imageregistry machineconfiguration network oauth project quota route samples security securityinternal template user; do
bash ${CODEGEN_PKG}/generate-groups.sh "lister,informer" \
github.com/openshift/client-go/${group} \
github.com/openshift/api \
Expand Down
96 changes: 96 additions & 0 deletions machineconfiguration/applyconfigurations/internal/internal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e81400b

Please sign in to comment.