From f3a8c23d55d7d81082bb374345713d00a217f3e8 Mon Sep 17 00:00:00 2001 From: Neil Hickey Date: Thu, 25 Aug 2022 12:16:15 -0600 Subject: [PATCH 1/8] WIP: Retrieve version information prior to fet,temp,deploy steps Signed-off-by: Neil Hickey --- cmd/controller/run.go | 27 +- config/crds.yml | 132 ++++ pkg/apis/kappctrl/v1alpha1/generated.pb.go | 734 ++++++++++++++---- pkg/apis/kappctrl/v1alpha1/generated.proto | 22 + pkg/apis/kappctrl/v1alpha1/types_template.go | 21 +- .../v1alpha1/zz_generated.deepcopy.go | 45 +- pkg/apiserver/openapi/zz_generated.openapi.go | 53 +- pkg/app/app.go | 6 +- pkg/app/app_deploy.go | 4 +- pkg/app/app_factory.go | 9 +- pkg/app/app_reconcile_test.go | 32 +- pkg/app/app_template.go | 26 +- pkg/app/app_test.go | 36 +- pkg/app/crd_app.go | 5 +- pkg/app/reconciler.go | 5 +- pkg/app/reconciler_test.go | 4 +- pkg/componentInfo/component_info.go | 77 ++ pkg/deploy/factory.go | 89 +-- pkg/deploy/interfaces.go | 13 - pkg/deploy/kapp.go | 25 +- pkg/kubeconfig/kubeconfig.go | 66 ++ .../kubeconfig_restricted.go | 2 +- .../kubeconfig_secrets.go | 20 +- .../service_accounts.go | 14 +- pkg/packageinstall/packageinstall.go | 44 +- .../packageinstall_deletion_test.go | 24 +- .../packageinstall_downgrade_test.go | 15 +- pkg/packageinstall/packageinstall_test.go | 116 +-- pkg/packageinstall/reconciler.go | 16 +- pkg/pkgrepository/app_deploy.go | 3 +- pkg/pkgrepository/app_factory.go | 4 +- pkg/pkgrepository/app_reconcile_test.go | 7 +- pkg/pkgrepository/app_template.go | 8 +- pkg/pkgrepository/app_test.go | 9 +- pkg/pkgrepository/crd_app.go | 1 - pkg/template/cue.go | 15 +- pkg/template/downward_api_values.go | 48 +- pkg/template/factory.go | 29 +- pkg/template/helm_template.go | 27 +- pkg/template/values.go | 14 +- pkg/template/values_factory.go | 22 + pkg/template/values_test.go | 39 + pkg/template/ytt.go | 17 +- test/e2e/kappcontroller/template_test.go | 50 ++ 44 files changed, 1467 insertions(+), 508 deletions(-) create mode 100644 pkg/componentInfo/component_info.go create mode 100644 pkg/kubeconfig/kubeconfig.go rename pkg/{deploy => kubeconfig}/kubeconfig_restricted.go (99%) rename pkg/{deploy => kubeconfig}/kubeconfig_secrets.go (75%) rename pkg/{deploy => kubeconfig}/service_accounts.go (91%) create mode 100644 pkg/template/values_factory.go diff --git a/cmd/controller/run.go b/cmd/controller/run.go index 0977d164f..1c43f99f2 100644 --- a/cmd/controller/run.go +++ b/cmd/controller/run.go @@ -6,6 +6,8 @@ package main import ( "context" "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "net/http" // Pprof related _ "net/http/pprof" // Pprof related "os" @@ -18,7 +20,6 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/app" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" kcconfig "github.com/vmware-tanzu/carvel-kapp-controller/pkg/config" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" pkginstall "github.com/vmware-tanzu/carvel-kapp-controller/pkg/packageinstall" @@ -170,20 +171,22 @@ func Run(opts Options, runLog logr.Logger) error { refTracker := reftracker.NewAppRefTracker() updateStatusTracker := reftracker.NewAppUpdateStatus() - // initialize deploy factory once - the deploy factory contains a service account token cache which should be only setup once. - deployFactory := deploy.NewFactory(coreClient, kcConfig, sidecarCmdExec, runLog) + // initialize cluster access once - it contains a service account token cache which should be only setup once. + kubeconf := kubeconfig.NewKubeconfig(coreClient, runLog) + compInfo := componentInfo.NewComponentInfo(coreClient, kubeconf, Version) { // add controller for apps appFactory := app.CRDAppFactory{ - CoreClient: coreClient, - AppClient: kcClient, - KcConfig: kcConfig, - AppMetrics: appMetrics, - CmdRunner: sidecarCmdExec, - DeployFactory: deployFactory, + CoreClient: coreClient, + AppClient: kcClient, + KcConfig: kcConfig, + AppMetrics: appMetrics, + CmdRunner: sidecarCmdExec, + Kubeconf: kubeconf, + CompInfo: compInfo, } reconciler := app.NewReconciler(kcClient, runLog.WithName("app"), - appFactory, refTracker, updateStatusTracker) + appFactory, refTracker, updateStatusTracker, compInfo) ctrl, err := controller.New("app", mgr, controller.Options{ Reconciler: NewUniqueReconciler(&ErrReconciler{ @@ -206,7 +209,7 @@ func Run(opts Options, runLog logr.Logger) error { pkgToPkgInstallHandler := pkginstall.NewPackageInstallVersionHandler( kcClient, opts.PackagingGloablNS, runLog.WithName("handler")) - reconciler := pkginstall.NewReconciler(deployFactory, kcClient, pkgClient, coreClient, pkgToPkgInstallHandler, runLog.WithName("pkgi"), Version) + reconciler := pkginstall.NewReconciler(kcClient, pkgClient, coreClient, pkgToPkgInstallHandler, runLog.WithName("pkgi"), compInfo) ctrl, err := controller.New("pkgi", mgr, controller.Options{ Reconciler: reconciler, @@ -223,7 +226,7 @@ func Run(opts Options, runLog logr.Logger) error { } { // add controller for pkgrepositories - appFactory := pkgrepository.AppFactory{coreClient, kcClient, kcConfig, sidecarCmdExec} + appFactory := pkgrepository.AppFactory{coreClient, kcClient, kcConfig, sidecarCmdExec, kubeconf} reconciler := pkgrepository.NewReconciler(kcClient, coreClient, runLog.WithName("pkgr"), appFactory, refTracker, updateStatusTracker) diff --git a/config/crds.yml b/config/crds.yml index 69fe51b1f..cce2190f2 100644 --- a/config/crds.yml +++ b/config/crds.yml @@ -427,6 +427,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object @@ -445,6 +463,18 @@ spec: helmTemplate: description: Use helm template command to render helm chart properties: + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: description: Set name explicitly, default is App CR's name (optional; v0.13.0+) type: string @@ -471,6 +501,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object @@ -595,6 +643,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object @@ -966,6 +1032,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object @@ -984,6 +1068,18 @@ spec: helmTemplate: description: Use helm template command to render helm chart properties: + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: description: Set name explicitly, default is App CR's name (optional; v0.13.0+) type: string @@ -1010,6 +1106,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object @@ -1134,6 +1248,24 @@ spec: fieldPath: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string + kappControllerVersion: + description: 'Optional: Use kapp-controller version from live cluster' + properties: + version: + type: string + type: object + kubernetesAPIs: + description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + properties: + version: + type: string + type: object + kubernetesVersion: + description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + properties: + version: + type: string + type: object name: type: string type: object diff --git a/pkg/apis/kappctrl/v1alpha1/generated.pb.go b/pkg/apis/kappctrl/v1alpha1/generated.pb.go index a95e658f2..a4ace6191 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.pb.go +++ b/pkg/apis/kappctrl/v1alpha1/generated.pb.go @@ -1011,6 +1011,34 @@ func (m *GenericStatus) XXX_DiscardUnknown() { var xxx_messageInfo_GenericStatus proto.InternalMessageInfo +func (m *Version) Reset() { *m = Version{} } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { + return fileDescriptor_e972ccf085273df7, []int{35} +} +func (m *Version) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Version) XXX_Merge(src proto.Message) { + xxx_messageInfo_Version.Merge(m, src) +} +func (m *Version) XXX_Size() int { + return m.Size() +} +func (m *Version) XXX_DiscardUnknown() { + xxx_messageInfo_Version.DiscardUnknown(m) +} + +var xxx_messageInfo_Version proto.InternalMessageInfo + func init() { proto.RegisterType((*AppCluster)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppCluster") proto.RegisterType((*AppClusterKubeconfigSecretRef)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppClusterKubeconfigSecretRef") @@ -1048,6 +1076,7 @@ func init() { proto.RegisterType((*AppTemplateYtt)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppTemplateYtt") proto.RegisterType((*Condition)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Condition") proto.RegisterType((*GenericStatus)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GenericStatus") + proto.RegisterType((*Version)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Version") } func init() { @@ -1055,157 +1084,164 @@ func init() { } var fileDescriptor_e972ccf085273df7 = []byte{ - // 2389 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, - 0x15, 0xf6, 0x92, 0x94, 0x48, 0x3e, 0x49, 0xb6, 0x32, 0xb6, 0x6b, 0x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f, 0x52, 0x60, 0xb6, - 0x4d, 0x4c, 0x42, 0x49, 0x65, 0x86, 0xcb, 0xf1, 0x66, 0x56, 0x72, 0xac, 0x73, 0x94, 0x06, 0x30, - 0xf5, 0x8a, 0x6f, 0x2c, 0x91, 0xd5, 0x1b, 0x70, 0x7a, 0x02, 0xe9, 0x01, 0xa5, 0x2a, 0xd3, 0x94, - 0xaa, 0x6e, 0xc0, 0x99, 0x49, 0x27, 0xff, 0x9f, 0xf9, 0xfc, 0x65, 0x16, 0x4a, 0xab, 0xae, 0xbb, - 0x41, 0xa8, 0xde, 0x45, 0xdf, 0x67, 0x26, 0x62, 0x1a, 0x36, 0x91, 0xe6, 0xfa, 0xf0, 0x78, 0xf5, - 0xc3, 0x41, 0xb6, 0x38, 0x80, 0x50, 0x8d, 0xf8, 0xc6, 0x12, 0x14, 0x0d, 0x60, 0xc6, 0xb0, 0xb4, - 0x0e, 0x91, 0x21, 0xe4, 0xb5, 0x2c, 0xd0, 0x19, 0x7f, 0x61, 0xd3, 0xfc, 0x13, 0x0b, 0x44, 0x14, - 0x40, 0xa1, 0x4b, 0xa9, 0x5b, 0xc9, 0x73, 0xe4, 0x6f, 0x65, 0x80, 0x7c, 0x73, 0x67, 0xa7, 0x29, - 0xbc, 0x94, 0x7d, 0x61, 0x0e, 0x87, 0xbe, 0x07, 0xf9, 0x8e, 0x11, 0x7a, 0xc5, 0x83, 0x0c, 0x50, - 0x37, 0x0d, 0xda, 0x28, 0xb2, 0xf0, 0xb4, 0x69, 0x50, 0xcc, 0xb0, 0xd0, 0xcf, 0x14, 0x28, 0x77, - 0x89, 0x69, 0xad, 0x75, 0x35, 0x8f, 0x4a, 0x3f, 0xf8, 0x4e, 0x16, 0xe7, 0x0d, 0x31, 0x1a, 0x0b, - 0xec, 0x09, 0x89, 0x86, 0x38, 0x46, 0x47, 0xbf, 0x56, 0x60, 0xde, 0xb0, 0x3a, 0x6e, 0xaf, 0xd3, - 0x08, 0xec, 0xb6, 0x49, 0x2a, 0xb3, 0x59, 0x84, 0x07, 0x79, 0xf1, 0x31, 0x4c, 0x63, 0x71, 0x34, - 0xac, 0xce, 0x27, 0x67, 0x70, 0x4a, 0x0c, 0xf6, 0x06, 0xb8, 0x1a, 0xed, 0x56, 0x8a, 0xe9, 0x37, - 0xa0, 0xa9, 0xd1, 0x2e, 0xe6, 0x2b, 0xea, 0xdf, 0xf3, 0x30, 0x97, 0xd0, 0x31, 0x7b, 0x13, 0x02, - 0xcf, 0x94, 0x91, 0x35, 0x7a, 0x13, 0xee, 0xe3, 0x3b, 0x98, 0xcd, 0xb3, 0x65, 0x4f, 0x3e, 0x8d, - 0x89, 0x65, 0xf6, 0x48, 0xb1, 0x79, 0xf4, 0x73, 0x05, 0xe6, 0x3d, 0xb2, 0xd7, 0x22, 0x26, 0xd1, - 0x99, 0x5b, 0x4a, 0x3d, 0xec, 0x4c, 0xd3, 0x83, 0x48, 0x45, 0xf8, 0xf1, 0xe5, 0x67, 0x98, 0x95, - 0xc4, 0x0a, 0x78, 0x20, 0x66, 0x22, 0xde, 0xe2, 0xf0, 0x38, 0x81, 0x86, 0x53, 0xd8, 0xe8, 0x5d, - 0x05, 0xca, 0x7e, 0xf4, 0x9a, 0x0b, 0x87, 0xf8, 0x76, 0x06, 0x37, 0x72, 0xc7, 0xd1, 0x35, 0x93, - 0x3d, 0xe0, 0xdc, 0x3e, 0xe2, 0x67, 0x3b, 0x06, 0x47, 0x97, 0xa0, 0xe8, 0x07, 0xbb, 0x4c, 0xed, - 0xdc, 0x45, 0xca, 0x8d, 0x53, 0x52, 0x75, 0xc5, 0x96, 0x98, 0xc6, 0xe1, 0x3a, 0xfa, 0x06, 0x2c, - 0x98, 0x7b, 0x7e, 0xab, 0x67, 0xb8, 0x2d, 0x2b, 0x68, 0x77, 0x44, 0x84, 0x2f, 0x35, 0xce, 0xca, - 0x0d, 0x0b, 0x77, 0x36, 0x5a, 0xf1, 0x22, 0x4e, 0xd3, 0xaa, 0xef, 0xe5, 0x60,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85, 0xde, 0x81, 0xa2, 0x2e, 0xba, 0x2b, 0xf2, - 0x72, 0xee, 0x67, 0xd2, 0x09, 0x12, 0x25, 0xbe, 0x1c, 0xe0, 0x10, 0x12, 0xed, 0xc3, 0xcc, 0x1e, - 0x53, 0x04, 0x6f, 0x4b, 0xcc, 0xad, 0xb4, 0x32, 0x30, 0x8c, 0x38, 0x24, 0xf0, 0x21, 0x16, 0x80, - 0xe8, 0x27, 0x0a, 0x94, 0x28, 0xb1, 0x5c, 0x53, 0xa3, 0xa4, 0x52, 0xe0, 0xe8, 0xc7, 0x5c, 0xd0, - 0xed, 0x48, 0xee, 0x8d, 0x45, 0x29, 0x40, 0x29, 0x9c, 0xc1, 0x11, 0x32, 0x7a, 0x07, 0x66, 0xdb, - 0xbc, 0x29, 0x50, 0x99, 0xe1, 0x32, 0xec, 0x64, 0xd1, 0xe2, 0x88, 0x13, 0x5e, 0x31, 0xc6, 0x12, - 0x93, 0x25, 0xc6, 0xae, 0x16, 0xf8, 0xa4, 0xcd, 0x2b, 0x98, 0x52, 0x4c, 0xd7, 0xe4, 0xb3, 0x58, - 0xae, 0xa2, 0xaf, 0x41, 0x49, 0xd7, 0x6c, 0x9d, 0x98, 0xa4, 0xcd, 0x8b, 0xac, 0x52, 0x7c, 0xa6, - 0x35, 0x39, 0x8f, 0x23, 0x0a, 0xf4, 0x26, 0x80, 0x3f, 0xb0, 0xf5, 0x26, 0xf1, 0x0c, 0xa7, 0x5d, - 0x29, 0x71, 0xab, 0xaa, 0xd5, 0x44, 0xdb, 0xb3, 0x96, 0x6c, 0x7b, 0xc6, 0xc2, 0x5b, 0x84, 0x6a, - 0xb5, 0xfe, 0x95, 0xda, 0x7a, 0xe0, 0x69, 0xfc, 0xed, 0xe3, 0xa9, 0x5f, 0x2b, 0xe2, 0x82, 0x13, - 0x1c, 0xd1, 0x0a, 0x80, 0xed, 0x38, 0xb2, 0x13, 0x53, 0x29, 0x73, 0x79, 0x90, 0x94, 0x07, 0xee, - 0x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74, 0x97, + 0x50, 0x4c, 0xf6, 0x0b, 0x13, 0xe7, 0x95, 0x0b, 0x33, 0x2b, 0xcd, 0xd2, 0xb1, 0xed, 0x65, 0x29, + 0xd2, 0x72, 0x7b, 0x18, 0xaf, 0x72, 0xb6, 0xdf, 0x2b, 0x9e, 0x1e, 0x31, 0x80, 0x47, 0x69, 0xa7, + 0xbe, 0x09, 0xe7, 0x9e, 0x2a, 0x0e, 0x9d, 0x87, 0x2c, 0x5b, 0xa3, 0x34, 0xc1, 0xac, 0x34, 0x41, + 0x96, 0x99, 0x00, 0xf3, 0x11, 0x74, 0x0e, 0x32, 0x2d, 0xd2, 0xe5, 0xeb, 0xcc, 0x57, 0x66, 0x24, + 0x43, 0x66, 0x9b, 0x74, 0x31, 0xa3, 0xab, 0x3f, 0x50, 0x20, 0xbf, 0xea, 0x38, 0xeb, 0xc4, 0x31, + 0xed, 0x2e, 0xea, 0x40, 0x96, 0x2d, 0x88, 0x8b, 0x9b, 0x59, 0x79, 0xf5, 0x78, 0xad, 0x22, 0x30, + 0xb6, 0x35, 0xc7, 0xa9, 0x4c, 0x33, 0x25, 0xd9, 0x13, 0xe6, 0x78, 0xea, 0x7b, 0x19, 0x98, 0x4b, + 0x70, 0xa0, 0x97, 0x61, 0xca, 0xb0, 0xa8, 0x7d, 0xdb, 0x93, 0x4b, 0x9b, 0x97, 0x9a, 0x4f, 0x6d, + 0x71, 0x2a, 0x96, 0xa3, 0xa8, 0x08, 0x93, 0x6d, 0xcd, 0xb9, 0xed, 0x15, 0x26, 0xce, 0x67, 0x2e, + 0xe4, 0x2b, 0xf9, 0x7e, 0xaf, 0x38, 0xb9, 0xc3, 0x08, 0x58, 0xd0, 0x51, 0x09, 0xc0, 0xd5, 0x1e, + 0xde, 0x71, 0x28, 0x73, 0xff, 0x42, 0x86, 0x73, 0xcd, 0xf7, 0x7b, 0x45, 0xc0, 0x21, 0x15, 0xc7, + 0x38, 0xd0, 0x8f, 0x14, 0xc8, 0x19, 0x96,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x6b, 0x19, 0x4e, 0xad, 0xed, 0xd7, 0x1b, 0x22, 0xc2, 0x4f, 0x57, + 0x16, 0xe5, 0x84, 0xb9, 0x5b, 0x1b, 0xb5, 0x68, 0x10, 0x27, 0x79, 0xd5, 0x77, 0x27, 0x60, 0x36, + 0x7e, 0x4e, 0xc7, 0x6d, 0xe7, 0xcb, 0x30, 0xe5, 0x35, 0xb5, 0x95, 0x57, 0xae, 0xca, 0x1d, 0x0d, + 0x53, 0x69, 0xed, 0xc6, 0xea, 0xca, 0x2b, 0x57, 0xb1, 0x1c, 0xfd, 0x74, 0x9a, 0x92, 0x15, 0x86, + 0xa7, 0x86, 0x4e, 0xf1, 0x11, 0xea, 0xa2, 0x8b, 0x90, 0x93, 0xee, 0x27, 0xcd, 0x12, 0x42, 0x48, + 0x1f, 0xc4, 0xc1, 0x38, 0x7a, 0xa4, 0x00, 0xb8, 0xc4, 0xb1, 0x3d, 0x83, 0xda, 0x6e, 0x57, 0x5a, + 0xe6, 0xcd, 0x34, 0xa3, 0x10, 0x26, 0x8e, 0x2d, 0x13, 0x61, 0x88, 0x8b, 0x63, 0x3a, 0xa8, 0x7f, + 0x51, 0x60, 0x71, 0xe4, 0xac, 0x71, 0xce, 0x90, 0xdc, 0xe4, 0x89, 0xe7, 0xb8, 0xc9, 0xea, 0x7f, + 0x27, 0x78, 0xd1, 0x17, 0x65, 0xba, 0x71, 0xba, 0xb3, 0xc0, 0x43, 0xb5, 0x46, 0x14, 0x78, 0xb2, + 0x69, 0x07, 0x9e, 0xdd, 0x18, 0x1a, 0x4e, 0x60, 0xbf, 0x40, 0x86, 0x8c, 0x9f, 0x96, 0xcc, 0x98, + 0xd3, 0xf2, 0xe1, 0x04, 0xaf, 0xc4, 0x86, 0x92, 0x0c, 0x7a, 0x29, 0xa8, 0x66, 0x84, 0xf1, 0xe7, + 0xa4, 0x84, 0x64, 0xdd, 0x31, 0xb4, 0x01, 0x99, 0xcf, 0x36, 0x80, 0x79, 0xf2, 0x7f,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, 0xa0, 0xe1, 0x30, 0xa6, 0xae, 0xc0, 0xc9, 0x81, 0x24, 0x34, 0xf6, + 0x00, 0xab, 0x9f, 0xe3, 0x37, 0x99, 0xa1, 0xe8, 0xac, 0xfe, 0x61, 0x22, 0x21, 0x8c, 0x05, 0x27, + 0x74, 0x00, 0x19, 0xa7, 0x11, 0x7c, 0x98, 0x7b, 0x3d, 0xbd, 0x78, 0x58, 0xdd, 0xac, 0x8a, 0xd0, + 0x54, 0xdd, 0xac, 0x62, 0x06, 0x19, 0x2d, 0x63, 0xe2, 0x90, 0x38, 0x74, 0x00, 0x19, 0xad, 0x11, + 0xa4, 0xd4, 0x14, 0x55, 0x5b, 0x6d, 0xc8, 0xa8, 0xb9, 0xda, 0x20, 0x98, 0x41, 0xaa, 0x1f, 0x2a, + 0x89, 0xbd, 0x90, 0x4c, 0xe8, 0x7d, 0x05, 0xce, 0x38, 0xae, 0xd1, 0x61, 0x46, 0x25, 0x5d, 0xaf, + 0x36, 0x70, 0x29, 0xb4, 0x52, 0xb4, 0xde, 0x08, 0xd4, 0x4a, 0xa1, 0xdf, 0x2b, 0x9e, 0x19, 0x35, + 0x82, 0x47, 0x6a, 0x39, 0x6a, 0x55, 0xd5, 0xcd, 0xea, 0xa7, 0x7d, 0x55, 0x9b, 0xf0, 0xd2, 0x11, + 0xc4, 0x1e, 0xe1, 0x2a, 0xf8, 0x47, 0x05, 0xbe, 0x38, 0x14, 0xe6, 0xd6, 0xed, 0x87, 0xd6, 0x43, + 0xcd, 0xad, 0xaf, 0x56, 0xb7, 0xd0, 0x23, 0x05, 0x26, 0x0d, 0x4a, 0xda, 0x41, 0xeb, 0xa5, 0x95, + 0x66, 0x7c, 0x8d, 0x01, 0x6f, 0x51, 0xd2, 0x8e, 0x35, 0xce, 0x98, 0x06, 0x58, 0x28, 0xa2, 0xfe, + 0x2d, 0x0b, 0xe7, 0xc7, 0x4d, 0x3d, 0x5a, 0x46, 0xda, 0x37, 0x88, 0x59, 0x8f, 0x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0x2a, 0xda, 0xca, 0x90, 0xe4, 0xe1, 0x18, 0x36, 0xda, + 0x81, 0xd3, 0xfb, 0xae, 0x41, 0xac, 0xba, 0xd9, 0x5d, 0x27, 0x9e, 0xee, 0x1a, 0x0e, 0x8d, 0x6e, + 0xdb, 0x5f, 0x90, 0x93, 0x4f, 0x6f, 0x0c, 0xb3, 0xe0, 0x51, 0xf3, 0x98, 0x95, 0x7c, 0x8f, 0xec, + 0xfb, 0xe6, 0x75, 0xd7, 0xb5, 0xdd, 0x9d, 0x84, 0xb5, 0x43, 0x2b, 0xdd, 0x1d, 0xe2, 0xc0, 0x23, + 0x66, 0xa9, 0x57, 0x20, 0xf8, 0x90, 0x1e, 0xff, 0xd4, 0xae, 0x3c, 0xfd, 0x53, 0x7b, 0xa5, 0xf4, + 0xf8, 0xc9, 0xf2, 0x89, 0x0f, 0x9e, 0x2c, 0x9f, 0xf8, 0xe8, 0xc9, 0xf2, 0x89, 0xef, 0xf6, 0x97, + 0x95, 0xc7, 0xfd, 0x65, 0xe5, 0x83, 0xfe, 0xb2, 0xf2, 0x51, 0x7f, 0x59, 0xf9, 0x57, 0x7f, 0x59, + 0x79, 0xf4, 0xef, 0xe5, 0x13, 0xaf, 0x4d, 0x07, 0xa6, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x55, 0x7e, 0x86, 0xd2, 0xdf, 0x2b, 0x00, 0x00, } func (m *AppCluster) Marshal() (dAtA []byte, err error) { @@ -2334,6 +2370,30 @@ func (m *AppTemplateHelmTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.KubernetesAPIs != nil { + { + size, err := m.KubernetesAPIs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.KubernetesVersion != nil { + { + size, err := m.KubernetesVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.ValuesFrom) > 0 { for iNdEx := len(m.ValuesFrom) - 1; iNdEx >= 0; iNdEx-- { { @@ -2655,6 +2715,42 @@ func (m *AppTemplateValuesDownwardAPIItem) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + if m.KubernetesAPIs != nil { + { + size, err := m.KubernetesAPIs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.KappControllerVersion != nil { + { + size, err := m.KappControllerVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.KubernetesVersion != nil { + { + size, err := m.KubernetesVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } i -= len(m.FieldPath) copy(dAtA[i:], m.FieldPath) i = encodeVarintGenerated(dAtA, i, uint64(len(m.FieldPath))) @@ -2936,6 +3032,34 @@ func (m *GenericStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Version) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Version) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -3383,6 +3507,14 @@ func (m *AppTemplateHelmTemplate) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.KubernetesVersion != nil { + l = m.KubernetesVersion.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.KubernetesAPIs != nil { + l = m.KubernetesAPIs.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -3504,6 +3636,18 @@ func (m *AppTemplateValuesDownwardAPIItem) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.FieldPath) n += 1 + l + sovGenerated(uint64(l)) + if m.KubernetesVersion != nil { + l = m.KubernetesVersion.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.KappControllerVersion != nil { + l = m.KappControllerVersion.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.KubernetesAPIs != nil { + l = m.KubernetesAPIs.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -3611,6 +3755,17 @@ func (m *GenericStatus) Size() (n int) { return n } +func (m *Version) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3914,6 +4069,8 @@ func (this *AppTemplateHelmTemplate) String() string { `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `ValuesFrom:` + repeatedStringForValuesFrom + `,`, + `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "Version", "Version", 1) + `,`, `}`, }, "") return s @@ -4010,6 +4167,9 @@ func (this *AppTemplateValuesDownwardAPIItem) String() string { s := strings.Join([]string{`&AppTemplateValuesDownwardAPIItem{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, + `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, + `KappControllerVersion:` + strings.Replace(this.KappControllerVersion.String(), "Version", "Version", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "Version", "Version", 1) + `,`, `}`, }, "") return s @@ -4088,6 +4248,16 @@ func (this *GenericStatus) String() string { }, "") return s } +func (this *Version) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Version{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -7608,6 +7778,78 @@ func (m *AppTemplateHelmTemplate) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KubernetesVersion", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KubernetesVersion == nil { + m.KubernetesVersion = &Version{} + } + if err := m.KubernetesVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KubernetesAPIs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KubernetesAPIs == nil { + m.KubernetesAPIs = &Version{} + } + if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8396,6 +8638,114 @@ func (m *AppTemplateValuesDownwardAPIItem) Unmarshal(dAtA []byte) error { } m.FieldPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KubernetesVersion", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KubernetesVersion == nil { + m.KubernetesVersion = &Version{} + } + if err := m.KubernetesVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KappControllerVersion", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KappControllerVersion == nil { + m.KappControllerVersion = &Version{} + } + if err := m.KappControllerVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KubernetesAPIs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KubernetesAPIs == nil { + m.KubernetesAPIs = &Version{} + } + if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9258,6 +9608,88 @@ func (m *GenericStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *Version) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Version: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/pkg/apis/kappctrl/v1alpha1/generated.proto b/pkg/apis/kappctrl/v1alpha1/generated.proto index d7ae2d2e6..701ffb986 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.proto +++ b/pkg/apis/kappctrl/v1alpha1/generated.proto @@ -331,6 +331,13 @@ message AppTemplateHelmTemplate { // One or more secrets, config maps, paths that provide values (optional) repeated AppTemplateValuesSource valuesFrom = 4; + + // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. + // Can be manually overridden to a value instead. + optional Version kubernetesVersion = 5; + + // Optional: Use kubernetes group/versions resources available in the live cluster + optional Version kubernetesAPIs = 6; } // TODO implement jsonnet @@ -387,6 +394,16 @@ message AppTemplateValuesDownwardAPIItem { // Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported. optional string fieldPath = 2; + + // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. + // Can be manually overridden to a value instead. + optional Version kubernetesVersion = 3; + + // Optional: Use kapp-controller version from live cluster + optional Version kappControllerVersion = 4; + + // Optional: Use kubernetes group/versions resources available in the live cluster + optional Version kubernetesAPIs = 5; } // +k8s:openapi-gen=true @@ -463,3 +480,8 @@ message GenericStatus { optional string usefulErrorMessage = 4; } +// +k8s:openapi-gen=true +message Version { + optional string version = 1; +} + diff --git a/pkg/apis/kappctrl/v1alpha1/types_template.go b/pkg/apis/kappctrl/v1alpha1/types_template.go index 58c5cb957..ba53cc6a9 100644 --- a/pkg/apis/kappctrl/v1alpha1/types_template.go +++ b/pkg/apis/kappctrl/v1alpha1/types_template.go @@ -53,6 +53,11 @@ type AppTemplateHelmTemplate struct { Path string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"` // One or more secrets, config maps, paths that provide values (optional) ValuesFrom []AppTemplateValuesSource `json:"valuesFrom,omitempty" protobuf:"bytes,4,rep,name=valuesFrom"` + // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. + // Can be manually overridden to a value instead. + KubernetesVersion *Version `json:"kubernetesVersion,omitempty" protobuf:"bytes,5,opt,name=kubernetesVersion"` + // Optional: Use kubernetes group/versions resources available in the live cluster + KubernetesAPIs *Version `json:"kubernetesAPIs,omitempty" protobuf:"bytes,6,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true @@ -68,16 +73,28 @@ type AppTemplateValuesSourceRef struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` } +// +k8s:openapi-gen=true +type AppTemplateValuesDownwardAPI struct { + Items []AppTemplateValuesDownwardAPIItem `json:"items,omitempty" protobuf:"bytes,1,opt,name=items"` +} + // +k8s:openapi-gen=true type AppTemplateValuesDownwardAPIItem struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported. FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,2,opt,name=fieldPath"` + // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. + // Can be manually overridden to a value instead. + KubernetesVersion *Version `json:"kubernetesVersion,omitempty" protobuf:"bytes,3,opt,name=kubernetesVersion"` + // Optional: Use kapp-controller version from live cluster + KappControllerVersion *Version `json:"kappControllerVersion,omitempty" protobuf:"bytes,4,opt,name=kappControllerVersion"` + // Optional: Use kubernetes group/versions resources available in the live cluster + KubernetesAPIs *Version `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true -type AppTemplateValuesDownwardAPI struct { - Items []AppTemplateValuesDownwardAPIItem `json:"items,omitempty" protobuf:"bytes,1,opt,name=items"` +type Version struct { + Version string `json:"version,omitempty" protobut:"bytes,1,opt,version=version" protobuf:"bytes,1,opt,name=version"` } // TODO implement kustomize diff --git a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go index c8d42c15d..cda2d3846 100644 --- a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go @@ -731,6 +731,16 @@ func (in *AppTemplateHelmTemplate) DeepCopyInto(out *AppTemplateHelmTemplate) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.KubernetesVersion != nil { + in, out := &in.KubernetesVersion, &out.KubernetesVersion + *out = new(Version) + **out = **in + } + if in.KubernetesAPIs != nil { + in, out := &in.KubernetesAPIs, &out.KubernetesAPIs + *out = new(Version) + **out = **in + } return } @@ -892,7 +902,9 @@ func (in *AppTemplateValuesDownwardAPI) DeepCopyInto(out *AppTemplateValuesDownw if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AppTemplateValuesDownwardAPIItem, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } @@ -910,6 +922,21 @@ func (in *AppTemplateValuesDownwardAPI) DeepCopy() *AppTemplateValuesDownwardAPI // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppTemplateValuesDownwardAPIItem) DeepCopyInto(out *AppTemplateValuesDownwardAPIItem) { *out = *in + if in.KubernetesVersion != nil { + in, out := &in.KubernetesVersion, &out.KubernetesVersion + *out = new(Version) + **out = **in + } + if in.KappControllerVersion != nil { + in, out := &in.KappControllerVersion, &out.KappControllerVersion + *out = new(Version) + **out = **in + } + if in.KubernetesAPIs != nil { + in, out := &in.KubernetesAPIs, &out.KubernetesAPIs + *out = new(Version) + **out = **in + } return } @@ -1087,3 +1114,19 @@ func (in *KappDeployStatus) DeepCopy() *KappDeployStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Version) DeepCopyInto(out *Version) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Version. +func (in *Version) DeepCopy() *Version { + if in == nil { + return nil + } + out := new(Version) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index c214917b4..23d306990 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -50,6 +50,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSourceRef": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesSourceRef(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateYtt": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateYtt(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Condition": schema_pkg_apis_kappctrl_v1alpha1_Condition(ref), + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version": schema_pkg_apis_kappctrl_v1alpha1_Version(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.AppTemplateSpec": schema_apiserver_apis_datapackaging_v1alpha1_AppTemplateSpec(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.IncludedSoftware": schema_apiserver_apis_datapackaging_v1alpha1_IncludedSoftware(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.Maintainer": schema_apiserver_apis_datapackaging_v1alpha1_Maintainer(ref), @@ -1154,11 +1155,23 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateHelmTemplate(ref common.Refere }, }, }, + "kubernetesVersion": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + }, + }, + "kubernetesAPIs": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Use kubernetes group/versions resources available in the live cluster", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1352,9 +1365,29 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesDownwardAPIItem(ref comm Format: "", }, }, + "kubernetesVersion": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + }, + }, + "kappControllerVersion": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Use kapp-controller version from live cluster", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + }, + }, + "kubernetesAPIs": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Use kubernetes group/versions resources available in the live cluster", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + }, + }, }, }, }, + Dependencies: []string{ + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1530,6 +1563,24 @@ func schema_pkg_apis_kappctrl_v1alpha1_Condition(ref common.ReferenceCallback) c } } +func schema_pkg_apis_kappctrl_v1alpha1_Version(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_apiserver_apis_datapackaging_v1alpha1_AppTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/app/app.go b/pkg/app/app.go index f8a6d88fe..9d5b9ab83 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -4,6 +4,7 @@ package app import ( + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "sync" "github.com/go-logr/logr" @@ -31,6 +32,7 @@ type App struct { fetchFactory fetch.Factory templateFactory template.Factory deployFactory deploy.Factory + compInfo componentInfo.Info log logr.Logger appMetrics *metrics.AppMetrics @@ -42,11 +44,11 @@ type App struct { func NewApp(app v1alpha1.App, hooks Hooks, fetchFactory fetch.Factory, templateFactory template.Factory, - deployFactory deploy.Factory, log logr.Logger, appMetrics *metrics.AppMetrics) *App { + deployFactory deploy.Factory, log logr.Logger, appMetrics *metrics.AppMetrics, compInfo componentInfo.Info) *App { return &App{app: app, appPrev: *(app.DeepCopy()), hooks: hooks, fetchFactory: fetchFactory, templateFactory: templateFactory, - deployFactory: deployFactory, log: log, appMetrics: appMetrics} + deployFactory: deployFactory, log: log, appMetrics: appMetrics, compInfo: compInfo} } func (a *App) Name() string { return a.app.Name } diff --git a/pkg/app/app_deploy.go b/pkg/app/app_deploy.go index 38ae329f9..9e80d6126 100644 --- a/pkg/app/app_deploy.go +++ b/pkg/app/app_deploy.go @@ -5,6 +5,7 @@ package app import ( "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" ctldep "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" @@ -134,10 +135,9 @@ func (a *App) trySaveMetadata(kapp *ctldep.Kapp) { } func (a *App) newKapp(kapp v1alpha1.AppDeployKapp, cancelCh chan struct{}) (*ctldep.Kapp, error) { - genericOpts := ctldep.GenericOpts{Name: a.app.Name, Namespace: a.app.Namespace} return a.deployFactory.NewKapp(kapp, a.app.Spec.ServiceAccountName, - a.app.Spec.Cluster, genericOpts, cancelCh) + a.app.Spec.Cluster, cancelCh, kubeconfig.AccessLocation{Name: a.app.Name, Namespace: a.app.Namespace}) } type cancelCondition func(v1alpha1.App) bool diff --git a/pkg/app/app_factory.go b/pkg/app/app_factory.go index 63d208d64..d2acf26d6 100644 --- a/pkg/app/app_factory.go +++ b/pkg/app/app_factory.go @@ -7,10 +7,12 @@ import ( "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/config" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" vendirconf "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/config" @@ -26,7 +28,8 @@ type CRDAppFactory struct { VendirConfigHook func(vendirconf.Config) vendirconf.Config KbldAllowBuild bool CmdRunner exec.CmdRunner - DeployFactory deploy.Factory + Kubeconf *kubeconfig.Kubeconfig + CompInfo componentInfo.Info } // NewCRDApp creates a CRDApp injecting necessary dependencies. @@ -35,7 +38,9 @@ func (f *CRDAppFactory) NewCRDApp(app *kcv1alpha1.App, log logr.Logger) *CRDApp SkipTLSConfig: f.KcConfig, ConfigHook: f.VendirConfigHook, } + fetchFactory := fetch.NewFactory(f.CoreClient, vendirOpts, f.CmdRunner) templateFactory := template.NewFactory(f.CoreClient, fetchFactory, f.KbldAllowBuild, f.CmdRunner) - return NewCRDApp(app, log, f.AppMetrics, f.AppClient, fetchFactory, templateFactory, f.DeployFactory) + deployFactory := deploy.NewFactory(f.CoreClient, f.Kubeconf, f.KcConfig, f.CmdRunner, log) + return NewCRDApp(app, log, f.AppMetrics, f.AppClient, fetchFactory, templateFactory, deployFactory, f.CompInfo) } diff --git a/pkg/app/app_reconcile_test.go b/pkg/app/app_reconcile_test.go index b1dbefcc6..bcfc57251 100644 --- a/pkg/app/app_reconcile_test.go +++ b/pkg/app/app_reconcile_test.go @@ -5,6 +5,8 @@ package app import ( "fmt" + "github.com/k14s/semver/v4" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" @@ -44,9 +46,9 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) { kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac) + crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac, FakeComponentInfo{}) _, err := crdApp.Reconcile(false) assert.Nil(t, err, "unexpected error with reconciling", err) @@ -110,9 +112,9 @@ func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) { kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac) + crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac, FakeComponentInfo{}) _, err := crdApp.Reconcile(false) assert.Nil(t, err, "unexpected error with reconciling", err) @@ -181,9 +183,9 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing. kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac) + crdApp := NewCRDApp(&app, log, appMetrics, kappcs, fetchFac, tmpFac, deployFac, FakeComponentInfo{}) _, err := crdApp.Reconcile(false) assert.Nil(t, err, "Unexpected error with reconciling", err) @@ -223,3 +225,21 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing. reflect.DeepEqual(expectedStatus, crdApp.app.Status()), fmt.Sprintf("Status is not same:\nExpected:\n%#v\nGot:\n%#v\n", expectedStatus, crdApp.app.Status())) } + +type FakeComponentInfo struct { + KCVersion semver.Version + K8sVersion semver.Version + K8sAPIs []string +} + +func (f FakeComponentInfo) KubernetesAPIs() ([]string, error) { + return f.K8sAPIs, nil +} + +func (f FakeComponentInfo) KappControllerVersion() (semver.Version, error) { + return f.KCVersion, nil +} + +func (f FakeComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { + return f.K8sVersion, nil +} diff --git a/pkg/app/app_template.go b/pkg/app/app_template.go index 1d9e4a178..4b90b014e 100644 --- a/pkg/app/app_template.go +++ b/pkg/app/app_template.go @@ -26,20 +26,40 @@ func (a *App) template(dirPath string) exec.CmdRunResult { var result exec.CmdRunResult var isStream bool + kubernetesVersion, err := a.compInfo.KubernetesVersion(a.app.Spec.ServiceAccountName, a.app.Spec.Cluster, &a.app.ObjectMeta) + if err != nil { + result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes version before templating")) + return result + } + + kappControllerVersion, err := a.compInfo.KappControllerVersion() + if err != nil { + result.AttachErrorf("%s", fmt.Errorf("Unable to get kapp-controller version before templating")) + return result + } + + k8sAPIs, err := a.compInfo.KubernetesAPIs() + if err != nil { + result.AttachErrorf("%s", fmt.Errorf("Unable to list all server apigroups/version before templating")) + return result + } + + additionalValues := ctltpl.AdditionalDownwardAPIValues{KubernetesVersion: kubernetesVersion, KappControllerVersion: kappControllerVersion, KubernetesAPIs: k8sAPIs} + for _, tpl := range a.app.Spec.Template { var template ctltpl.Template switch { case tpl.Ytt != nil: - template = a.templateFactory.NewYtt(*tpl.Ytt, appContext) + template = a.templateFactory.NewYtt(*tpl.Ytt, appContext, additionalValues) case tpl.Kbld != nil: template = a.templateFactory.NewKbld(*tpl.Kbld, appContext) case tpl.HelmTemplate != nil: - template = a.templateFactory.NewHelmTemplate(*tpl.HelmTemplate, appContext) + template = a.templateFactory.NewHelmTemplate(*tpl.HelmTemplate, appContext, additionalValues) case tpl.Sops != nil: template = a.templateFactory.NewSops(*tpl.Sops, appContext) case tpl.Cue != nil: - template = a.templateFactory.NewCue(*tpl.Cue, appContext) + template = a.templateFactory.NewCue(*tpl.Cue, appContext, additionalValues) default: result.AttachErrorf("%s", fmt.Errorf("Unsupported way to template")) return result diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 0f4045caf..d06ce8f8d 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -4,6 +4,8 @@ package app_test import ( + "github.com/k14s/semver/v4" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" @@ -59,9 +61,9 @@ func Test_SecretRefs_RetrievesAllSecretRefs(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, FakeComponentInfo{}) out := app.SecretRefs() assert.Truef(t, reflect.DeepEqual(out, expected), "Expected: %s\nGot: %s\n", expected, out) @@ -83,9 +85,9 @@ func Test_SecretRefs_RetrievesNoSecretRefs_WhenNonePresent(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, FakeComponentInfo{}) out := app.SecretRefs() assert.Equal(t, 0, len(out), "No SecretRefs to be returned") @@ -121,9 +123,9 @@ func Test_ConfigMapRefs_RetrievesAllConfigMapRefs(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, FakeComponentInfo{}) out := app.ConfigMapRefs() assert.Truef(t, reflect.DeepEqual(out, expected), "Expected: %s\nGot: %s\n", expected, out) @@ -145,10 +147,28 @@ func Test_ConfigMapRefs_RetrievesNoConfigMapRefs_WhenNonePresent(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, FakeComponentInfo{}) out := app.ConfigMapRefs() assert.Lenf(t, out, 0, "Expected: %s\nGot: %s\n", "No ConfigMapRefs to be returned", out) } + +type FakeComponentInfo struct { + KCVersion semver.Version + K8sVersion semver.Version + K8sAPIs []string +} + +func (f FakeComponentInfo) KubernetesAPIs() ([]string, error) { + return f.K8sAPIs, nil +} + +func (f FakeComponentInfo) KappControllerVersion() (semver.Version, error) { + return f.KCVersion, nil +} + +func (f FakeComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { + return f.K8sVersion, nil +} diff --git a/pkg/app/crd_app.go b/pkg/app/crd_app.go index 9c897aaf2..3d387760e 100644 --- a/pkg/app/crd_app.go +++ b/pkg/app/crd_app.go @@ -6,6 +6,7 @@ package app import ( "context" "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "reflect" "github.com/go-logr/logr" @@ -31,7 +32,7 @@ type CRDApp struct { // NewCRDApp creates new CRD app func NewCRDApp(appModel *kcv1alpha1.App, log logr.Logger, appMetrics *metrics.AppMetrics, appClient kcclient.Interface, fetchFactory fetch.Factory, - templateFactory template.Factory, deployFactory deploy.Factory) *CRDApp { + templateFactory template.Factory, deployFactory deploy.Factory, compInfo componentInfo.Info) *CRDApp { crdApp := &CRDApp{appModel: appModel, log: log, appMetrics: appMetrics, appClient: appClient} @@ -40,7 +41,7 @@ func NewCRDApp(appModel *kcv1alpha1.App, log logr.Logger, appMetrics *metrics.Ap UnblockDeletion: crdApp.unblockDeletion, UpdateStatus: crdApp.updateStatus, WatchChanges: crdApp.watchChanges, - }, fetchFactory, templateFactory, deployFactory, log, appMetrics) + }, fetchFactory, templateFactory, deployFactory, log, appMetrics, compInfo) return crdApp } diff --git a/pkg/app/reconciler.go b/pkg/app/reconciler.go index d996a9d34..67955ba46 100644 --- a/pkg/app/reconciler.go +++ b/pkg/app/reconciler.go @@ -6,6 +6,7 @@ package app import ( "context" "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -29,16 +30,18 @@ type Reconciler struct { crdAppFactory CRDAppFactory appRefTracker *reftracker.AppRefTracker appUpdateStatus *reftracker.AppUpdateStatus + componentInfo componentInfo.Info } // NewReconciler constructs new Reconciler. func NewReconciler(appClient kcclient.Interface, log logr.Logger, crdAppFactory CRDAppFactory, - appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus) *Reconciler { + appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus, componentInfo componentInfo.Info) *Reconciler { return &Reconciler{appClient: appClient, log: log, crdAppFactory: crdAppFactory, appRefTracker: appRefTracker, appUpdateStatus: appUpdateStatus, + componentInfo: componentInfo, } } diff --git a/pkg/app/reconciler_test.go b/pkg/app/reconciler_test.go index 07303809b..ba651eb60 100644 --- a/pkg/app/reconciler_test.go +++ b/pkg/app/reconciler_test.go @@ -37,7 +37,7 @@ func Test_AppRefTracker_HasAppRemovedForSecrets_ThatAreNoLongerUsedByApp(t *test appKey := reftracker.NewAppKey(app.Name, app.Namespace) appRefTracker.ReconcileRefs(refKeyMap, appKey) - ar := apppkg.NewReconciler(nil, nil, apppkg.CRDAppFactory{}, appRefTracker, nil) + ar := apppkg.NewReconciler(nil, nil, apppkg.CRDAppFactory{}, appRefTracker, nil, FakeComponentInfo{}) // This map represents the secrets the App has on its spec refMap := map[reftracker.RefKey]struct{}{ @@ -89,7 +89,7 @@ func Test_AppRefTracker_HasNoAppsRemoved_WhenRefsRemainSame(t *testing.T) { appKey := reftracker.NewAppKey(app.Name, app.Namespace) appRefTracker.ReconcileRefs(refKeyMap, appKey) - ar := apppkg.NewReconciler(nil, nil, apppkg.CRDAppFactory{}, appRefTracker, nil) + ar := apppkg.NewReconciler(nil, nil, apppkg.CRDAppFactory{}, appRefTracker, nil, FakeComponentInfo{}) // This map represents the secrets the App has // on its spec diff --git a/pkg/componentInfo/component_info.go b/pkg/componentInfo/component_info.go new file mode 100644 index 000000000..ae89ea56e --- /dev/null +++ b/pkg/componentInfo/component_info.go @@ -0,0 +1,77 @@ +package componentInfo + +import ( + "fmt" + "github.com/k14s/semver/v4" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" +) + +type Info interface { + KappControllerVersion() (semver.Version, error) + KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) + KubernetesAPIs() ([]string, error) +} + +type ComponentInfo struct { + coreClient kubernetes.Interface + clusterAccess *kubeconfig.Kubeconfig + kappControllerVersion string +} + +func NewComponentInfo(coreClient kubernetes.Interface, clusterAccess *kubeconfig.Kubeconfig, kappControllerVersion string) *ComponentInfo { + return &ComponentInfo{coreClient: coreClient, clusterAccess: clusterAccess, kappControllerVersion: kappControllerVersion} +} + +func (ci *ComponentInfo) KappControllerVersion() (semver.Version, error) { + v, err := semver.ParseTolerant(ci.kappControllerVersion) + if err != nil { + return semver.Version{}, err + } + return v, nil +} + +func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { + switch { + case len(serviceAccountName) > 0: + v, err := ci.coreClient.Discovery().ServerVersion() + if err != nil { + return semver.Version{}, err + } + return semver.ParseTolerant(v.String()) + case specCluster != nil: + accessInfo, err := ci.clusterAccess.ClusterAccess(serviceAccountName, specCluster, kubeconfig.AccessLocation{Name: objMeta.Name, Namespace: objMeta.Namespace}) + if err != nil { + return semver.Version{}, err + } + config, err := clientcmd.RESTConfigFromKubeConfig([]byte(accessInfo.Kubeconfig.AsYAML())) + if err != nil { + return semver.Version{}, err + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return semver.Version{}, err + } + + v, err := clientset.Discovery().ServerVersion() + if err != nil { + return semver.Version{}, err + } + return semver.ParseTolerant(v.String()) + default: + return semver.Version{}, fmt.Errorf("Expected service account or cluster specified") + } +} + +func (ci *ComponentInfo) KubernetesAPIs() ([]string, error) { + groups, err := ci.coreClient.Discovery().ServerGroups() + if err != nil { + return []string{}, err + } + + return metav1.ExtractGroupVersions(groups), nil +} diff --git a/pkg/deploy/factory.go b/pkg/deploy/factory.go index a465578d8..de792f802 100644 --- a/pkg/deploy/factory.go +++ b/pkg/deploy/factory.go @@ -4,15 +4,12 @@ package deploy import ( - "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/clientcmd" ) // Factory allows to build various deployers. @@ -22,10 +19,8 @@ type Factory struct { coreClient kubernetes.Interface kappConfig KappConfiguration - kubeconfigSecrets *KubeconfigSecrets - serviceAccounts *ServiceAccounts - - cmdRunner exec.CmdRunner + kubeconfig *kubeconfig.Kubeconfig + cmdRunner exec.CmdRunner } // KappConfiguration provides a way to inject shared kapp settings. @@ -34,69 +29,40 @@ type KappConfiguration interface { } // NewFactory returns deploy factory. -func NewFactory(coreClient kubernetes.Interface, +func NewFactory(coreClient kubernetes.Interface, kubeconfig *kubeconfig.Kubeconfig, kappConfig KappConfiguration, cmdRunner exec.CmdRunner, log logr.Logger) Factory { - return Factory{coreClient, kappConfig, - NewKubeconfigSecrets(coreClient), NewServiceAccounts(coreClient, log), cmdRunner} + return Factory{coreClient, kappConfig, kubeconfig, cmdRunner} } // NewKapp configures and returns a deployer of type Kapp func (f Factory) NewKapp(opts v1alpha1.AppDeployKapp, saName string, - clusterOpts *v1alpha1.AppCluster, genericOpts GenericOpts, cancelCh chan struct{}) (*Kapp, error) { + clusterOpts *v1alpha1.AppCluster, cancelCh chan struct{}, location kubeconfig.AccessLocation) (*Kapp, error) { - processedGenericOpts, err := f.processOpts(saName, clusterOpts, genericOpts) + clusterAccess, err := f.kubeconfig.ClusterAccess(saName, clusterOpts, location) if err != nil { return nil, err } + const suffix string = ".app" - return NewKapp(suffix, opts, processedGenericOpts, + return NewKapp(suffix, opts, clusterAccess, f.globalKappDeployRawOpts(), cancelCh, f.cmdRunner), nil } -// processOpts takes generic opts and a ServiceAccount Name, and returns a populated kubeconfig that can connect to a cluster. -// if the saName is empty then you'll connect to a cluster via the clusterOpts inside the genericOpts, otherwise you'll use the specified SA. -func (f Factory) processOpts(saName string, clusterOpts *v1alpha1.AppCluster, genericOpts GenericOpts) (ProcessedGenericOpts, error) { - var err error - var processedGenericOpts ProcessedGenericOpts - - switch { - case len(saName) > 0: - processedGenericOpts, err = f.serviceAccounts.Find(genericOpts, saName) - if err != nil { - return ProcessedGenericOpts{}, err - } - - case clusterOpts != nil: - processedGenericOpts, err = f.kubeconfigSecrets.Find(genericOpts, clusterOpts) - if err != nil { - return ProcessedGenericOpts{}, err - } - - default: - return ProcessedGenericOpts{}, fmt.Errorf("Expected service account or cluster specified") - } - return processedGenericOpts, nil -} - // NewKappPrivileged is used for package repositories where users aren't required to provide // a service account, so it will install resources using its own privileges. -func (f Factory) NewKappPrivilegedForPackageRepository(opts v1alpha1.AppDeployKapp, - genericOpts GenericOpts, cancelCh chan struct{}) (*Kapp, error) { +func (f Factory) NewKappPrivilegedForPackageRepository(opts v1alpha1.AppDeployKapp, clusterAccess kubeconfig.AccessInfo, cancelCh chan struct{}) (*Kapp, error) { const suffix string = ".pkgr" - pgo := ProcessedGenericOpts{ - Name: genericOpts.Name, - Namespace: genericOpts.Namespace, - // Just use the default service account. Mainly - // used for PackageRepos now so users do not need - // to specify serviceaccount via PackageRepo CR. + kconfAccess := kubeconfig.AccessInfo{ + Name: clusterAccess.Name, + Namespace: clusterAccess.Namespace, Kubeconfig: nil, DangerousUsePodServiceAccount: true, } - return NewKapp(suffix, opts, pgo, f.globalKappDeployRawOpts(), cancelCh, f.cmdRunner), nil + return NewKapp(suffix, opts, kconfAccess, f.globalKappDeployRawOpts(), cancelCh, f.cmdRunner), nil } func (f Factory) globalKappDeployRawOpts() []string { @@ -105,30 +71,3 @@ func (f Factory) globalKappDeployRawOpts() []string { } return nil } - -// GetClusterVersion returns the kubernetes API version for the cluster which has been supplied to kapp-controller via a kubeconfig -func (f Factory) GetClusterVersion(saName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta, log logr.Logger) (*version.Info, error) { - switch { - case len(saName) > 0: - return f.coreClient.Discovery().ServerVersion() - case specCluster != nil: - processedGenericOpts, err := f.processOpts(saName, specCluster, GenericOpts{Name: objMeta.Name, Namespace: objMeta.Namespace}) - if err != nil { - return nil, err - } - - config, err := clientcmd.RESTConfigFromKubeConfig([]byte(processedGenericOpts.Kubeconfig.AsYAML())) - if err != nil { - return nil, err - } - - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - - return clientset.Discovery().ServerVersion() - default: - return nil, fmt.Errorf("Expected service account or cluster specified") - } -} diff --git a/pkg/deploy/interfaces.go b/pkg/deploy/interfaces.go index be0954bc2..9a1112500 100644 --- a/pkg/deploy/interfaces.go +++ b/pkg/deploy/interfaces.go @@ -16,16 +16,3 @@ type Deploy interface { Inspect() exec.CmdRunResult } - -type GenericOpts struct { - Name string - Namespace string -} - -type ProcessedGenericOpts struct { - Name string - Namespace string - - Kubeconfig *KubeconfigRestricted - DangerousUsePodServiceAccount bool -} diff --git a/pkg/deploy/kapp.go b/pkg/deploy/kapp.go index c13edd74f..4d9fd16e6 100644 --- a/pkg/deploy/kapp.go +++ b/pkg/deploy/kapp.go @@ -7,6 +7,7 @@ import ( "bytes" "errors" "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "gopkg.in/yaml.v2" "os" goexec "os/exec" @@ -28,7 +29,7 @@ const ( type Kapp struct { appSuffix string opts v1alpha1.AppDeployKapp - genericOpts ProcessedGenericOpts + clusterAccess kubeconfig.AccessInfo globalDeployRawOpts []string cancelCh chan struct{} cmdRunner exec.CmdRunner @@ -40,10 +41,10 @@ var _ Deploy = &Kapp{} // NewKapp takes the kapp yaml from spec.deploy.kapp as arg kapp, // additional info from the larger app resource (e.g. service account, name, namespace) as genericOpts, // and a cancel channel that gets passed through to the exec call that runs kapp. -func NewKapp(appSuffix string, opts v1alpha1.AppDeployKapp, genericOpts ProcessedGenericOpts, +func NewKapp(appSuffix string, opts v1alpha1.AppDeployKapp, clusterAccess kubeconfig.AccessInfo, globalDeployRawOpts []string, cancelCh chan struct{}, cmdRunner exec.CmdRunner) *Kapp { - return &Kapp{appSuffix, opts, genericOpts, globalDeployRawOpts, cancelCh, cmdRunner, nil} + return &Kapp{appSuffix, opts, clusterAccess, globalDeployRawOpts, cancelCh, cmdRunner, nil} } // Deploy takes the output from templating, and the app name, @@ -66,7 +67,7 @@ func (a *Kapp) Deploy(tplOutput string, startedApplyingFunc func(), return exec.NewCmdRunResultWithErr(err) } - args, env := a.addGenericArgs(args, a.genericOpts.Name+a.appSuffix) + args, env := a.addGenericArgs(args, a.clusterAccess.Name+a.appSuffix) cmd := goexec.Command("kapp", args...) cmd.Env = append(os.Environ(), env...) @@ -93,7 +94,7 @@ func (a *Kapp) Delete(startedApplyingFunc func(), changedFunc func(exec.CmdRunRe return exec.NewCmdRunResultWithErr(err) } - args, env := a.addGenericArgs(args, a.genericOpts.Name+a.appSuffix) + args, env := a.addGenericArgs(args, a.clusterAccess.Name+a.appSuffix) cmd := goexec.Command("kapp", args...) cmd.Env = append(os.Environ(), env...) @@ -123,7 +124,7 @@ func (a *Kapp) Inspect() exec.CmdRunResult { return exec.NewCmdRunResultWithErr(err) } - args, env := a.addGenericArgs(args, a.genericOpts.Name+a.appSuffix) + args, env := a.addGenericArgs(args, a.clusterAccess.Name+a.appSuffix) var stdoutBs, stderrBs bytes.Buffer @@ -200,7 +201,7 @@ func (a *Kapp) trackCmdOutput(cmd *goexec.Cmd, startedApplyingFunc func(), // This is the old naming schema for KC owned kapp apps. // The new convention is x.app for AppCRs / PKGIs and x.pkgr for PackageRepositories. -func (a *Kapp) oldManagedName() string { return a.genericOpts.Name + "-ctrl" } +func (a *Kapp) oldManagedName() string { return a.clusterAccess.Name + "-ctrl" } func (a *Kapp) addDeployArgs(args []string) ([]string, error) { if len(a.opts.IntoNs) > 0 { @@ -253,15 +254,15 @@ func (a *Kapp) addGenericArgs(args []string, appName string) ([]string, []string args = append(args, []string{"--app", appName}...) env := []string{} - if len(a.genericOpts.Namespace) > 0 { - args = append(args, []string{"--namespace", a.genericOpts.Namespace}...) + if len(a.clusterAccess.Namespace) > 0 { + args = append(args, []string{"--namespace", a.clusterAccess.Namespace}...) } switch { - case a.genericOpts.Kubeconfig != nil: - env = append(env, "KAPP_KUBECONFIG_YAML="+a.genericOpts.Kubeconfig.AsYAML()) + case a.clusterAccess.Kubeconfig != nil: + env = append(env, "KAPP_KUBECONFIG_YAML="+a.clusterAccess.Kubeconfig.AsYAML()) args = append(args, "--kubeconfig=/dev/null") // not used due to above env var - case a.genericOpts.DangerousUsePodServiceAccount: + case a.clusterAccess.DangerousUsePodServiceAccount: // do nothing default: panic("Internal inconsistency: Unknown kapp service account configuration") diff --git a/pkg/kubeconfig/kubeconfig.go b/pkg/kubeconfig/kubeconfig.go new file mode 100644 index 000000000..0ee7a4f0f --- /dev/null +++ b/pkg/kubeconfig/kubeconfig.go @@ -0,0 +1,66 @@ +// Copyright 2022 VMware, Inc. +// SPDX-License-Identifier: Apache-2.0 + +package kubeconfig + +import ( + "fmt" + "github.com/go-logr/logr" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "k8s.io/client-go/kubernetes" +) + +// Kubeconfig provides access to the kubernetes cluster +// It initializes the service-account token cache +type Kubeconfig struct { + kubeconfigSecrets *KubeconfigSecrets + serviceAccounts *ServiceAccounts + log logr.Logger +} + +type AccessLocation struct { + Name string + Namespace string +} + +type AccessInfo struct { + Name string + Namespace string + + Kubeconfig *KubeconfigRestricted + DangerousUsePodServiceAccount bool +} + +// NewKubeconfig creates a Kubeconfig with a new serviceaccount cache and kubeconfigsecrets +func NewKubeconfig(coreClient kubernetes.Interface, log logr.Logger) *Kubeconfig { + return &Kubeconfig{ + kubeconfigSecrets: NewKubeconfigSecrets(coreClient), + serviceAccounts: NewServiceAccounts(coreClient, log), + log: log, + } +} + +// ClusterAccess takes cluster info and a ServiceAccount Name, and returns a populated kubeconfig that can connect to a cluster. +// if the saName is empty then you'll connect to a cluster via the clusterOpts inside the genericOpts, otherwise you'll use the specified SA. +func (k Kubeconfig) ClusterAccess(saName string, clusterOpts *v1alpha1.AppCluster, accessLocation AccessLocation) (AccessInfo, error) { + var err error + var clusterAccessInfo AccessInfo + + switch { + case len(saName) > 0: + clusterAccessInfo, err = k.serviceAccounts.Find(accessLocation, saName) + if err != nil { + return AccessInfo{}, err + } + + case clusterOpts != nil: + clusterAccessInfo, err = k.kubeconfigSecrets.Find(accessLocation, clusterOpts) + if err != nil { + return AccessInfo{}, err + } + + default: + return AccessInfo{}, fmt.Errorf("Expected service account or cluster specified") + } + return clusterAccessInfo, nil +} diff --git a/pkg/deploy/kubeconfig_restricted.go b/pkg/kubeconfig/kubeconfig_restricted.go similarity index 99% rename from pkg/deploy/kubeconfig_restricted.go rename to pkg/kubeconfig/kubeconfig_restricted.go index f8f8608a6..21ce00fdf 100644 --- a/pkg/deploy/kubeconfig_restricted.go +++ b/pkg/kubeconfig/kubeconfig_restricted.go @@ -1,7 +1,7 @@ // Copyright 2020 VMware, Inc. // SPDX-License-Identifier: Apache-2.0 -package deploy +package kubeconfig import ( "fmt" diff --git a/pkg/deploy/kubeconfig_secrets.go b/pkg/kubeconfig/kubeconfig_secrets.go similarity index 75% rename from pkg/deploy/kubeconfig_secrets.go rename to pkg/kubeconfig/kubeconfig_secrets.go index fc3cb78e5..06c547b3c 100644 --- a/pkg/deploy/kubeconfig_secrets.go +++ b/pkg/kubeconfig/kubeconfig_secrets.go @@ -1,7 +1,7 @@ // Copyright 2020 VMware, Inc. // SPDX-License-Identifier: Apache-2.0 -package deploy +package kubeconfig import ( "context" @@ -21,29 +21,29 @@ func NewKubeconfigSecrets(coreClient kubernetes.Interface) *KubeconfigSecrets { return &KubeconfigSecrets{coreClient} } -func (s *KubeconfigSecrets) Find(genericOpts GenericOpts, - clusterOpts *v1alpha1.AppCluster) (ProcessedGenericOpts, error) { +func (s *KubeconfigSecrets) Find(accessLocation AccessLocation, + clusterOpts *v1alpha1.AppCluster) (AccessInfo, error) { if clusterOpts == nil { - return ProcessedGenericOpts{}, fmt.Errorf("Internal inconsistency: Expected cluster to not be nil") + return AccessInfo{}, fmt.Errorf("Internal inconsistency: Expected cluster to not be nil") } if clusterOpts.KubeconfigSecretRef == nil { - return ProcessedGenericOpts{}, fmt.Errorf("Expected kubeconfig secret reference to be specified") + return AccessInfo{}, fmt.Errorf("Expected kubeconfig secret reference to be specified") } - kubeconfigYAML, err := s.fetchKubeconfigYAML(genericOpts.Namespace, clusterOpts.KubeconfigSecretRef) + kubeconfigYAML, err := s.fetchKubeconfigYAML(accessLocation.Namespace, clusterOpts.KubeconfigSecretRef) if err != nil { - return ProcessedGenericOpts{}, err + return AccessInfo{}, err } kubeconfigRestricted, err := NewKubeconfigRestricted(kubeconfigYAML) if err != nil { - return ProcessedGenericOpts{}, err + return AccessInfo{}, err } - pgoForCluster := ProcessedGenericOpts{ - Name: genericOpts.Name, + pgoForCluster := AccessInfo{ + Name: accessLocation.Name, // Override destination namespace; if it's empty // assume kubeconfig contains preferred namespace Namespace: clusterOpts.Namespace, diff --git a/pkg/deploy/service_accounts.go b/pkg/kubeconfig/service_accounts.go similarity index 91% rename from pkg/deploy/service_accounts.go rename to pkg/kubeconfig/service_accounts.go index 0c720cd39..07e07e3bc 100644 --- a/pkg/deploy/service_accounts.go +++ b/pkg/kubeconfig/service_accounts.go @@ -1,7 +1,7 @@ // Copyright 2020 VMware, Inc. // SPDX-License-Identifier: Apache-2.0 -package deploy +package kubeconfig import ( "context" @@ -36,19 +36,19 @@ func NewServiceAccounts(coreClient kubernetes.Interface, log logr.Logger) *Servi tokenManager: tokenMgr, caCert: []byte(os.Getenv("KAPPCTRL_KUBERNETES_CA_DATA"))} } -func (s *ServiceAccounts) Find(genericOpts GenericOpts, saName string) (ProcessedGenericOpts, error) { - kubeconfigYAML, err := s.fetchServiceAccount(genericOpts.Namespace, saName) +func (s *ServiceAccounts) Find(accessLocation AccessLocation, saName string) (AccessInfo, error) { + kubeconfigYAML, err := s.fetchServiceAccount(accessLocation.Namespace, saName) if err != nil { - return ProcessedGenericOpts{}, err + return AccessInfo{}, err } kubeconfigRestricted, err := NewKubeconfigRestricted(kubeconfigYAML) if err != nil { - return ProcessedGenericOpts{}, err + return AccessInfo{}, err } - pgoForSA := ProcessedGenericOpts{ - Name: genericOpts.Name, + pgoForSA := AccessInfo{ + Name: accessLocation.Name, Namespace: "", // Assume kubeconfig contains preferred namespace from SA Kubeconfig: kubeconfigRestricted, } diff --git a/pkg/packageinstall/packageinstall.go b/pkg/packageinstall/packageinstall.go index bb7edae85..467e7f47f 100644 --- a/pkg/packageinstall/packageinstall.go +++ b/pkg/packageinstall/packageinstall.go @@ -16,7 +16,7 @@ import ( pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/scheme" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reconciler" "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions" verv1alpha1 "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1" @@ -42,19 +42,18 @@ type PackageInstallCR struct { model *pkgingv1alpha1.PackageInstall unmodifiedModel *pkgingv1alpha1.PackageInstall - log logr.Logger - kcclient kcclient.Interface - pkgclient pkgclient.Interface - coreClient kubernetes.Interface - controllerVersion string - deployFactory deploy.Factory + log logr.Logger + kcclient kcclient.Interface + pkgclient pkgclient.Interface + coreClient kubernetes.Interface + compInfo componentInfo.Info } func NewPackageInstallCR(model *pkgingv1alpha1.PackageInstall, log logr.Logger, - kcclient kcclient.Interface, pkgclient pkgclient.Interface, coreClient kubernetes.Interface, controllerVersion string, deployFactory deploy.Factory) *PackageInstallCR { + kcclient kcclient.Interface, pkgclient pkgclient.Interface, coreClient kubernetes.Interface, compInfo componentInfo.Info) *PackageInstallCR { return &PackageInstallCR{model: model, unmodifiedModel: model.DeepCopy(), log: log, - kcclient: kcclient, pkgclient: pkgclient, coreClient: coreClient, controllerVersion: controllerVersion, deployFactory: deployFactory} + kcclient: kcclient, pkgclient: pkgclient, coreClient: coreClient, compInfo: compInfo} } func (pi *PackageInstallCR) Reconcile() (reconcile.Result, error) { @@ -225,17 +224,6 @@ func (pi *PackageInstallCR) clusterVersionConstraintsSatisfied(pkg *datapkgingv1 return constraintsFunc(clusterVersion) } -func dropVersionPreReleaseAndBuild(versionStr string) (semver.Version, error) { - v, err := semver.ParseTolerant(versionStr) - if err != nil { - return v, err - } - v.Pre = semver.PRVersion{} - v.Build = semver.BuildMeta{} - - return v, nil -} - func (pi *PackageInstallCR) kcVersionConstraintsSatisfied(pkg *datapkgingv1alpha1.Package) bool { if pkg.Spec.KappControllerVersionSelection == nil || pkg.Spec.KappControllerVersionSelection.Constraints == "" { return true @@ -248,12 +236,14 @@ func (pi *PackageInstallCR) kcVersionConstraintsSatisfied(pkg *datapkgingv1alpha return true } - v, err := dropVersionPreReleaseAndBuild(pi.controllerVersion) + v, err := pi.compInfo.KappControllerVersion() if err != nil { - pi.log.Error(err, "Unable to parse kapp-controller version", "version string", pi.controllerVersion) return false } + v.Pre = semver.PRVersion{} + v.Build = semver.BuildMeta{} + constraints, _ := semver.ParseRange(pkg.Spec.KappControllerVersionSelection.Constraints) // ignore err because validation should have already caught it return constraints(v) } @@ -305,19 +295,15 @@ func (pi *PackageInstallCR) referencedPkgVersion() (datapkgingv1alpha1.Package, vcc := []versions.ConstraintCallback{} // we only need to populate the versionInfo we know that the packages have constraints that will require this info. - v := semver.Version{} if requiresClusterVersion { - vi, err := pi.deployFactory.GetClusterVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta, pi.log) + v, err := pi.compInfo.KubernetesVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta) if err != nil { pi.log.Error(err, "Unable to retrieve cluster kubernetes version") return datapkgingv1alpha1.Package{}, err } - v, err = dropVersionPreReleaseAndBuild(vi.GitVersion) - if err != nil { - pi.log.Error(err, "Unable to parse cluster kubernetes version", "version string", vi.GitVersion) - return datapkgingv1alpha1.Package{}, err - } + v.Pre = semver.PRVersion{} + v.Build = semver.BuildMeta{} k8sConstraint := func(pkgVer string) bool { pkg := versionToPkg[pkgVer] diff --git a/pkg/packageinstall/packageinstall_deletion_test.go b/pkg/packageinstall/packageinstall_deletion_test.go index 6a4aa777d..907f57f7d 100644 --- a/pkg/packageinstall/packageinstall_deletion_test.go +++ b/pkg/packageinstall/packageinstall_deletion_test.go @@ -4,6 +4,7 @@ package packageinstall import ( + "github.com/k14s/semver/v4" "testing" "github.com/stretchr/testify/assert" @@ -11,8 +12,6 @@ import ( pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1" fakeapiserver "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned/fake" fakekappctrl "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/fake" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" versions "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" @@ -65,9 +64,8 @@ func Test_PackageInstallDeletion(t *testing.T) { pkgClient := fakeapiserver.NewSimpleClientset() appClient := fakekappctrl.NewSimpleClientset(pkgInstall, existingApp) coreClient := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(coreClient, nil, exec.NewPlainCmdRunner(), log) - ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, coreClient, "0.42.31337", deployFac) + ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, coreClient, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -79,3 +77,21 @@ func Test_PackageInstallDeletion(t *testing.T) { assert.Equal(t, true, app.Spec.Canceled) }) } + +type FakeComponentInfo struct { + KCVersion semver.Version + K8sVersion semver.Version + K8sAPIs []string +} + +func (f FakeComponentInfo) KubernetesAPIs() ([]string, error) { + return f.K8sAPIs, nil +} + +func (f FakeComponentInfo) KappControllerVersion() (semver.Version, error) { + return f.KCVersion, nil +} + +func (f FakeComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { + return f.K8sVersion, nil +} diff --git a/pkg/packageinstall/packageinstall_downgrade_test.go b/pkg/packageinstall/packageinstall_downgrade_test.go index 0caa531bb..a9a3d0e11 100644 --- a/pkg/packageinstall/packageinstall_downgrade_test.go +++ b/pkg/packageinstall/packageinstall_downgrade_test.go @@ -4,6 +4,7 @@ package packageinstall import ( + "github.com/k14s/semver/v4" "testing" "github.com/stretchr/testify/assert" @@ -13,8 +14,6 @@ import ( datapkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1" fakeapiserver "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned/fake" fakekappctrl "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/fake" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" versions "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -92,7 +91,6 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { pkgClient := fakeapiserver.NewSimpleClientset(&pkg1, &pkg2) appClient := fakekappctrl.NewSimpleClientset(pkgInstall, existingApp) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -100,7 +98,7 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -142,7 +140,6 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { pkgClient := fakeapiserver.NewSimpleClientset(&pkg1, &pkg2) appClient := fakekappctrl.NewSimpleClientset(pkgInstall, existingApp) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -150,7 +147,7 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -192,7 +189,6 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { pkgClient := fakeapiserver.NewSimpleClientset(&pkg1, &pkg2) appClient := fakekappctrl.NewSimpleClientset(pkgInstall, existingApp) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -200,7 +196,7 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -248,7 +244,6 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { pkgClient := fakeapiserver.NewSimpleClientset(&pkg1, &pkg2) appClient := fakekappctrl.NewSimpleClientset(pkgInstall, existingApp) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -256,7 +251,7 @@ func Test_PackageInstallVersionDowngrades(t *testing.T) { GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(pkgInstall, log, appClient, pkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) diff --git a/pkg/packageinstall/packageinstall_test.go b/pkg/packageinstall/packageinstall_test.go index 22055b48a..ff08a9057 100644 --- a/pkg/packageinstall/packageinstall_test.go +++ b/pkg/packageinstall/packageinstall_test.go @@ -5,6 +5,7 @@ package packageinstall import ( "fmt" + "github.com/k14s/semver/v4" "reflect" "testing" @@ -13,9 +14,6 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1" datapkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" - fakeapiserver "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned/fake" fakekappctrl "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/fake" versions "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1" @@ -32,7 +30,6 @@ import ( // https://github.com/vmware-tanzu/carvel-kapp-controller/issues/116 func Test_PackageRefWithPrerelease_IsFound(t *testing.T) { log := logf.Log.WithName("kc") - fakek8s := fake.NewSimpleClientset() // PackageMetadata with prerelease version expectedPackageVersion := datapkgingv1alpha1.Package{ @@ -48,14 +45,6 @@ func Test_PackageRefWithPrerelease_IsFound(t *testing.T) { // Load package into fake client fakePkgClient := fakeapiserver.NewSimpleClientset(&expectedPackageVersion) - // mock the kubernetes server version - fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) - fakeDiscovery.FakedServerVersion = &version.Info{ - GitVersion: "v0.20.0", - } - - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) - // PackageInstall that has PackageRef with prerelease ip := PackageInstallCR{ model: &pkgingv1alpha1.PackageInstall{ @@ -75,9 +64,9 @@ func Test_PackageRefWithPrerelease_IsFound(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - deployFactory: deployFactory, - log: log, + pkgclient: fakePkgClient, + log: log, + compInfo: FakeComponentInfo{K8sVersion: semver.MustParse("0.20.0")}, } out, err := ip.referencedPkgVersion() @@ -100,13 +89,6 @@ func Test_PackageWithConstraints(t *testing.T) { fakek8s := fake.NewSimpleClientset() pkg := generatePackageWithConstraints("pkg.test.carvel.dev", "0.0.0", ">1.0.0 <2.0.0", ">0.15.0") fakePkgClient := fakeapiserver.NewSimpleClientset(&pkg) - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) - - // mock the kubernetes server version - fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) - fakeDiscovery.FakedServerVersion = &version.Info{ - GitVersion: "v0.20.0", - } ip := PackageInstallCR{ model: &pkgingv1alpha1.PackageInstall{ @@ -123,11 +105,10 @@ func Test_PackageWithConstraints(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - controllerVersion: "1.5.0", - log: log, - coreClient: fakek8s, - deployFactory: deployFactory, + pkgclient: fakePkgClient, + log: log, + coreClient: fakek8s, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("1.5.0"), K8sVersion: semver.MustParse("0.20.0")}, } // all constraints met @@ -135,7 +116,7 @@ func Test_PackageWithConstraints(t *testing.T) { require.NoError(t, err) // kapp-controller version constraint fail - ip.controllerVersion = "3.0.0" + ip.compInfo = FakeComponentInfo{KCVersion: semver.MustParse("3.0.0"), K8sVersion: semver.MustParse("0.20.0")} _, err = ip.referencedPkgVersion() require.Error(t, err) assert.ErrorContains(t, err, "after-kubernetes-version-check=1") @@ -149,9 +130,7 @@ func Test_PackageWithConstraints(t *testing.T) { require.NoError(t, err) // kubernetes version constraint fail - fakeDiscovery.FakedServerVersion = &version.Info{ - GitVersion: "v0.0.0", - } + ip.compInfo = FakeComponentInfo{KCVersion: semver.MustParse("1.5.0"), K8sVersion: semver.MustParse("0.0.0")} _, err = ip.referencedPkgVersion() require.Error(t, err) assert.ErrorContains(t, err, "after-kubernetes-version-check=0") @@ -185,10 +164,10 @@ func Test_Package_NotFound(t *testing.T) { }, }, }, - pkgclient: fakePkgClient, - controllerVersion: "0.42.0", - log: log, - coreClient: fakek8s, + pkgclient: fakePkgClient, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("0.42.0")}, + log: log, + coreClient: fakek8s, } _, err := ip.referencedPkgVersion() @@ -201,7 +180,6 @@ func Test_Package_ConstraintNotGiven_ErrorDoesNotContainMessage(t *testing.T) { fakek8s := fake.NewSimpleClientset() pkg := generatePackageWithConstraints("pkg.test.carvel.dev", "0.0.0", "1.0.0", "") fakePkgClient := fakeapiserver.NewSimpleClientset(&pkg) - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) ip := PackageInstallCR{ model: &pkgingv1alpha1.PackageInstall{ @@ -218,11 +196,10 @@ func Test_Package_ConstraintNotGiven_ErrorDoesNotContainMessage(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - controllerVersion: "1.5.0", - log: log, - coreClient: fakek8s, - deployFactory: deployFactory, + pkgclient: fakePkgClient, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("1.5.0")}, + log: log, + coreClient: fakek8s, } _, err := ip.referencedPkgVersion() @@ -237,13 +214,6 @@ func Test_PackageWithConstraintsWithPrerelease(t *testing.T) { pkg := generatePackageWithConstraints("pkg.test.carvel.dev", "0.0.0", ">1.0.0 <2.0.0", "0.10.0") pkg2 := generatePackageWithConstraints("pkg.test.carvel.dev", "2.0.0", ">1.0.0 <2.0.0", "0.20.0") fakePkgClient := fakeapiserver.NewSimpleClientset(&pkg, &pkg2) - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) - - // mock the kubernetes server version - fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) - fakeDiscovery.FakedServerVersion = &version.Info{ - GitVersion: "v0.20.0-gke.100", - } ip := PackageInstallCR{ model: &pkgingv1alpha1.PackageInstall{ @@ -260,11 +230,10 @@ func Test_PackageWithConstraintsWithPrerelease(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - controllerVersion: "1.5.0", - log: log, - coreClient: fakek8s, - deployFactory: deployFactory, + pkgclient: fakePkgClient, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("1.5.0"), K8sVersion: semver.MustParse("0.20.0-gke.100")}, + log: log, + coreClient: fakek8s, } out, err := ip.referencedPkgVersion() @@ -280,13 +249,6 @@ func Test_PackageWithConstraints_HighestMatch(t *testing.T) { pkg2 := generatePackageWithConstraints(pkgName, "0.5.0", ">0.1.0", ">0.1.0") // this one is the highest installable version pkg3 := generatePackageWithConstraints(pkgName, "1.4.1", ">2.0.0", "") // higher version uninstallable fakePkgClient := fakeapiserver.NewSimpleClientset(&pkg1, &pkg2, &pkg3) - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) - - // mock the kubernetes server version - fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) - fakeDiscovery.FakedServerVersion = &version.Info{ - GitVersion: "v0.20.0", - } ip := PackageInstallCR{ model: &pkgingv1alpha1.PackageInstall{ @@ -303,11 +265,10 @@ func Test_PackageWithConstraints_HighestMatch(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - controllerVersion: "1.5.0", - log: log, - coreClient: fakek8s, - deployFactory: deployFactory, + pkgclient: fakePkgClient, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("1.5.0"), K8sVersion: semver.MustParse("0.20.0")}, + log: log, + coreClient: fakek8s, } out, err := ip.referencedPkgVersion() @@ -329,7 +290,6 @@ func Test_PackageRefWithPrerelease_DoesNotRequirePrereleaseMarker(t *testing.T) log := logf.Log.WithName("kc") fakek8s := fake.NewSimpleClientset() fakePkgClient := fakeapiserver.NewSimpleClientset(&expectedPackageVersion) - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -352,9 +312,9 @@ func Test_PackageRefWithPrerelease_DoesNotRequirePrereleaseMarker(t *testing.T) ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - deployFactory: deployFactory, - log: log, + pkgclient: fakePkgClient, + compInfo: FakeComponentInfo{KCVersion: semver.MustParse("1.5.0")}, + log: log, } out, err := ip.referencedPkgVersion() @@ -388,7 +348,6 @@ func Test_PackageRefUsesName(t *testing.T) { fakePkgClient := fakeapiserver.NewSimpleClientset(&expectedPackageVersion, &alternatePackageVersion) log := logf.Log.WithName("kc") fakek8s := fake.NewSimpleClientset() - deployFactory := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -412,9 +371,8 @@ func Test_PackageRefUsesName(t *testing.T) { ServiceAccountName: "use-local-cluster-sa", // saname being present indicates use local cluster version }, }, - pkgclient: fakePkgClient, - log: log, - deployFactory: deployFactory, + pkgclient: fakePkgClient, + log: log, } out, err := ip.referencedPkgVersion() @@ -470,7 +428,6 @@ func Test_PlaceHolderSecretCreated_WhenPackageHasNoSecretRef(t *testing.T) { log := logf.Log.WithName("kc") fakekctrl := fakekappctrl.NewSimpleClientset(model) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -478,7 +435,7 @@ func Test_PlaceHolderSecretCreated_WhenPackageHasNoSecretRef(t *testing.T) { GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -551,14 +508,13 @@ func Test_PlaceHolderSecretsCreated_WhenPackageHasMultipleFetchStages(t *testing log := logf.Log.WithName("kc") fakekctrl := fakekappctrl.NewSimpleClientset(model) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) fakeDiscovery.FakedServerVersion = &version.Info{ GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -641,7 +597,6 @@ func Test_PlaceHolderSecretsNotCreated_WhenFetchStagesHaveSecrets(t *testing.T) log := logf.Log.WithName("kc") fakekctrl := fakekappctrl.NewSimpleClientset(model) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) @@ -649,7 +604,7 @@ func Test_PlaceHolderSecretsNotCreated_WhenFetchStagesHaveSecrets(t *testing.T) GitVersion: "v0.20.0", } - ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) _, err := ip.Reconcile() assert.Nil(t, err) @@ -726,8 +681,7 @@ func Test_PlaceHolderSecretCreated_WhenPackageInstallUpdated(t *testing.T) { fakekctrl := fakekappctrl.NewSimpleClientset(model, existingApp) fakek8s := fake.NewSimpleClientset() - deployFac := deploy.NewFactory(fakek8s, nil, exec.NewPlainCmdRunner(), log) - ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, "0.42.31337", deployFac) + ip := NewPackageInstallCR(model, log, fakekctrl, fakePkgClient, fakek8s, FakeComponentInfo{KCVersion: semver.MustParse("0.42.31337")}) // mock the kubernetes server version fakeDiscovery, _ := fakek8s.Discovery().(*fakediscovery.FakeDiscovery) diff --git a/pkg/packageinstall/reconciler.go b/pkg/packageinstall/reconciler.go index e713c3206..4bbe50db7 100644 --- a/pkg/packageinstall/reconciler.go +++ b/pkg/packageinstall/reconciler.go @@ -6,6 +6,7 @@ package packageinstall import ( "context" "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/go-logr/logr" kappctrlv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -13,7 +14,6 @@ import ( datapkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1" pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -25,26 +25,24 @@ import ( // Reconciler is responsible for reconciling PackageInstalls. type Reconciler struct { - deployFactory deploy.Factory kcClient kcclient.Interface pkgClient pkgclient.Interface coreClient kubernetes.Interface pkgToPkgInstallHandler *PackageInstallVersionHandler - controllerVersion string + compInfo componentInfo.Info log logr.Logger } // NewReconciler is the constructor for the Reconciler struct -func NewReconciler(deployFactory deploy.Factory, kcClient kcclient.Interface, pkgClient pkgclient.Interface, +func NewReconciler(kcClient kcclient.Interface, pkgClient pkgclient.Interface, coreClient kubernetes.Interface, pkgToPkgInstallHandler *PackageInstallVersionHandler, - log logr.Logger, controllerVersion string) *Reconciler { + log logr.Logger, compInfo componentInfo.Info) *Reconciler { - return &Reconciler{deployFactory: deployFactory, - kcClient: kcClient, + return &Reconciler{kcClient: kcClient, pkgClient: pkgClient, coreClient: coreClient, pkgToPkgInstallHandler: pkgToPkgInstallHandler, - controllerVersion: controllerVersion, + compInfo: compInfo, log: log} } @@ -88,5 +86,5 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( return reconcile.Result{}, err } - return NewPackageInstallCR(existingPkgInstall, log, r.kcClient, r.pkgClient, r.coreClient, r.controllerVersion, r.deployFactory).Reconcile() + return NewPackageInstallCR(existingPkgInstall, log, r.kcClient, r.pkgClient, r.coreClient, r.compInfo).Reconcile() } diff --git a/pkg/pkgrepository/app_deploy.go b/pkg/pkgrepository/app_deploy.go index 10d5a4f36..2c16fa046 100644 --- a/pkg/pkgrepository/app_deploy.go +++ b/pkg/pkgrepository/app_deploy.go @@ -5,6 +5,7 @@ package pkgrepository import ( "fmt" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" ctldep "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" @@ -71,6 +72,6 @@ func (a *App) delete() exec.CmdRunResult { } func (a *App) newKapp(kapp v1alpha1.AppDeployKapp, cancelCh chan struct{}) (*ctldep.Kapp, error) { - genericOpts := ctldep.GenericOpts{Name: a.app.Name, Namespace: a.app.Namespace} + genericOpts := kubeconfig.AccessInfo{Name: a.app.Name, Namespace: a.app.Namespace} return a.deployFactory.NewKappPrivilegedForPackageRepository(kapp, genericOpts, cancelCh) } diff --git a/pkg/pkgrepository/app_factory.go b/pkg/pkgrepository/app_factory.go index 022d6d82d..8d6078f0d 100644 --- a/pkg/pkgrepository/app_factory.go +++ b/pkg/pkgrepository/app_factory.go @@ -12,6 +12,7 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" "k8s.io/client-go/kubernetes" ) @@ -22,12 +23,13 @@ type AppFactory struct { AppClient kcclient.Interface KcConfig *config.Config CmdRunner exec.CmdRunner + Kubeconf *kubeconfig.Kubeconfig } // NewCRDPackageRepo constructs "hidden" App to reconcile PackageRepository. func (f *AppFactory) NewCRDPackageRepo(app *kcv1alpha1.App, pkgr *pkgv1alpha1.PackageRepository, log logr.Logger) *CRDApp { fetchFactory := fetch.NewFactory(f.CoreClient, fetch.VendirOpts{SkipTLSConfig: f.KcConfig}, f.CmdRunner) templateFactory := template.NewFactory(f.CoreClient, fetchFactory, false, f.CmdRunner) - deployFactory := deploy.NewFactory(f.CoreClient, nil, f.CmdRunner, log) + deployFactory := deploy.NewFactory(f.CoreClient, f.Kubeconf, nil, f.CmdRunner, log) return NewCRDApp(app, pkgr, log, f.AppClient, fetchFactory, templateFactory, deployFactory) } diff --git a/pkg/pkgrepository/app_reconcile_test.go b/pkg/pkgrepository/app_reconcile_test.go index de8bcf773..9116a759b 100644 --- a/pkg/pkgrepository/app_reconcile_test.go +++ b/pkg/pkgrepository/app_reconcile_test.go @@ -4,6 +4,7 @@ package pkgrepository import ( + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "testing" "github.com/stretchr/testify/assert" @@ -40,7 +41,7 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) { kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) pkgr := v1alpha12.PackageRepository{} crdApp := NewCRDApp(&app, &pkgr, log, kappcs, fetchFac, tmpFac, deployFac) @@ -95,7 +96,7 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing. kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) pkgr := v1alpha12.PackageRepository{} crdApp := NewCRDApp(&app, &pkgr, log, kappcs, fetchFac, tmpFac, deployFac) @@ -150,7 +151,7 @@ func TestInvalidPackageRepositoryFormat(t *testing.T) { kappcs := fake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) pkgr := v1alpha12.PackageRepository{} crdApp := NewCRDApp(&app, &pkgr, log, kappcs, fetchFac, tmpFac, deployFac) diff --git a/pkg/pkgrepository/app_template.go b/pkg/pkgrepository/app_template.go index c4e1ed563..3e3f04dac 100644 --- a/pkg/pkgrepository/app_template.go +++ b/pkg/pkgrepository/app_template.go @@ -49,7 +49,9 @@ func (a *App) template(dirPath string) exec.CmdRunResult { IgnoreUnknownComments: true, Paths: []string{"packages"}, } - result, _ := a.templateFactory.NewYtt(template1, appContext).TemplateDir(dirPath) + additionalValues := ctltpl.AdditionalDownwardAPIValues{} + + result, _ := a.templateFactory.NewYtt(template1, appContext, additionalValues).TemplateDir(dirPath) if result.Error != nil { return result } @@ -58,7 +60,7 @@ func (a *App) template(dirPath string) exec.CmdRunResult { // some of which could be migrated to go code stream := strings.NewReader(result.Stdout) result = a.templateFactory.NewYtt( - a.yttTemplateCleanRs(), appContext).TemplateStream(stream, dirPath) + a.yttTemplateCleanRs(), appContext, additionalValues).TemplateStream(stream, dirPath) if result.Error != nil { return result } @@ -75,7 +77,7 @@ func (a *App) template(dirPath string) exec.CmdRunResult { // on identical resources provided by multiple pkgrs stream = strings.NewReader(resources) result = a.templateFactory.NewYtt( - a.yttTemplateAddIdenticalRsRebase(), appContext).TemplateStream(stream, dirPath) + a.yttTemplateAddIdenticalRsRebase(), appContext, additionalValues).TemplateStream(stream, dirPath) if result.Error != nil { return result } diff --git a/pkg/pkgrepository/app_test.go b/pkg/pkgrepository/app_test.go index 9dba69adc..fc84cb2c0 100644 --- a/pkg/pkgrepository/app_test.go +++ b/pkg/pkgrepository/app_test.go @@ -4,6 +4,7 @@ package pkgrepository_test import ( + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" @@ -48,9 +49,9 @@ func Test_SecretRefs_RetrievesAllSecretRefs(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appWithRefs, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, nil) out := app.SecretRefs() if !reflect.DeepEqual(out, expected) { @@ -74,9 +75,9 @@ func Test_SecretRefs_RetrievesNoSecretRefs_WhenNonePresent(t *testing.T) { k8scs := k8sfake.NewSimpleClientset() fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) - deployFac := deploy.NewFactory(k8scs, nil, exec.NewPlainCmdRunner(), log) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) - app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil) + app := apppkg.NewApp(appEmpty, apppkg.Hooks{}, fetchFac, tmpFac, deployFac, log, nil, nil) out := app.SecretRefs() if len(out) != 0 { diff --git a/pkg/pkgrepository/crd_app.go b/pkg/pkgrepository/crd_app.go index 7b2b1acba..be5e63d64 100644 --- a/pkg/pkgrepository/crd_app.go +++ b/pkg/pkgrepository/crd_app.go @@ -6,7 +6,6 @@ package pkgrepository import ( "context" "fmt" - "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1" diff --git a/pkg/template/cue.go b/pkg/template/cue.go index 5165d5a41..286f6cae3 100644 --- a/pkg/template/cue.go +++ b/pkg/template/cue.go @@ -16,19 +16,20 @@ import ( ) type cue struct { - opts v1alpha1.AppTemplateCue - coreClient kubernetes.Interface - appContext AppContext - cmdRunner exec.CmdRunner + opts v1alpha1.AppTemplateCue + coreClient kubernetes.Interface + appContext AppContext + cmdRunner exec.CmdRunner + valuesFactory ValuesFactory } var _ Template = &cue{} func newCue(opts v1alpha1.AppTemplateCue, appContext AppContext, - coreClient kubernetes.Interface, cmdRunner exec.CmdRunner) *cue { + coreClient kubernetes.Interface, cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *cue { return &cue{opts: opts, appContext: appContext, - coreClient: coreClient, cmdRunner: cmdRunner} + coreClient: coreClient, cmdRunner: cmdRunner, valuesFactory: valuesFactory} } // TemplateDir works on directory returning templating result, @@ -59,7 +60,7 @@ func (c *cue) template(dirPath string, input io.Reader) exec.CmdRunResult { args = append(args, c.opts.Paths...) } - vals := Values{c.opts.ValuesFrom, c.appContext, c.coreClient} + vals := c.valuesFactory.NewValues(c.opts.ValuesFrom, c.appContext) paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { return exec.NewCmdRunResultWithErr(fmt.Errorf("Writing values: %w", err)) diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 476813237..7bd35674d 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -6,6 +6,7 @@ package template import ( "errors" "fmt" + "github.com/k14s/semver/v4" "regexp" "strings" @@ -14,31 +15,54 @@ import ( "k8s.io/client-go/util/jsonpath" ) +type AdditionalDownwardAPIValues struct { + KappControllerVersion semver.Version + KubernetesVersion semver.Version + KubernetesAPIs []string +} + // DownwardAPIValues produces multiple key-values based on the DownwardAPI config // queried against the object metadata type DownwardAPIValues struct { - items []v1alpha1.AppTemplateValuesDownwardAPIItem - metadata PartialObjectMetadata + items []v1alpha1.AppTemplateValuesDownwardAPIItem + metadata PartialObjectMetadata + additionalDownwardAPIValues AdditionalDownwardAPIValues } // AsYAMLs returns many key-values queried (using jsonpath) against an object metadata provided. func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { dataValues := [][]byte{} + keyValueContent := []byte{} + for _, item := range a.items { err := a.validateName(item.Name) if err != nil { return nil, err } - fieldPathExpression, err := relaxedJSONPathExpression(item.FieldPath) - if err != nil { - return nil, err + switch { + case item.FieldPath != "": + fieldPathExpression, err := relaxedJSONPathExpression(item.FieldPath) + if err != nil { + return nil, err + } + keyValueContent, err = a.extractFieldPathAsKeyValue(item.Name, fieldPathExpression) + if err != nil { + return nil, err + } + case item.KubernetesVersion != nil: + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion.String()}) + if err != nil { + return nil, err + } + case item.KappControllerVersion != nil: + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion.String()}) + case item.KubernetesAPIs != nil: + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(a.additionalDownwardAPIValues.KubernetesAPIs, ",")}) + default: + return nil, fmt.Errorf("Invalid downward API item given") } - keyValueContent, err := a.extractFieldPathAsKeyValue(item.Name, fieldPathExpression) - if err != nil { - return nil, err - } dataValues = append(dataValues, keyValueContent) } @@ -89,8 +113,7 @@ func (DownwardAPIValues) nestedKeyValue(name string, val interface{}) ([]byte, e nestedMap = nextLevel } - yamlContent, err := yaml.Marshal(root) - return yamlContent, err + return yaml.Marshal(root) } func splitWithEscaping(s string, separator, escape byte) []string { @@ -107,8 +130,7 @@ func splitWithEscaping(s string, separator, escape byte) []string { token = append(token, s[i]) } } - tokens = append(tokens, string(token)) - return tokens + return append(tokens, string(token)) } // Copied from https://github.com/kubernetes/kubectl/blob/ac26f503e81287d9903761a1a8ded25fdebec6a7/pkg/cmd/get/customcolumn.go#L38 diff --git a/pkg/template/factory.go b/pkg/template/factory.go index 20cf4fb5c..fc38e178f 100644 --- a/pkg/template/factory.go +++ b/pkg/template/factory.go @@ -26,8 +26,14 @@ func NewFactory(coreClient kubernetes.Interface, fetchFactory fetch.Factory, } // NewYtt returns ytt template. -func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext) *Ytt { - return NewYtt(opts, appContext, f.coreClient, f.fetchFactory, f.cmdRunner) +func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) *Ytt { + vf := ValuesFactory{ + fetchFactory: f.fetchFactory, + coreClient: f.coreClient, + additionaDownwardAPIValues: additionalDownwardAPIValues, + } + + return NewYtt(opts, appContext, f.coreClient, f.fetchFactory, f.cmdRunner, vf) } // NewKbld returns kbld template. @@ -37,8 +43,14 @@ func (f Factory) NewKbld(opts v1alpha1.AppTemplateKbld, appContext AppContext) * // NewHelmTemplate returns helm template. func (f Factory) NewHelmTemplate( - opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext) *HelmTemplate { - return NewHelmTemplate(opts, appContext, f.coreClient, f.cmdRunner) + opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) *HelmTemplate { + vf := ValuesFactory{ + fetchFactory: f.fetchFactory, + coreClient: f.coreClient, + additionaDownwardAPIValues: additionalDownwardAPIValues, + } + + return NewHelmTemplate(opts, appContext, f.coreClient, f.cmdRunner, vf) } func (f Factory) NewSops( @@ -47,6 +59,11 @@ func (f Factory) NewSops( } // NewCue returns a Cue templater -func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext) Template { - return newCue(opts, appContext, f.coreClient, f.cmdRunner) +func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) Template { + vf := ValuesFactory{ + fetchFactory: f.fetchFactory, + coreClient: f.coreClient, + additionaDownwardAPIValues: additionalDownwardAPIValues, + } + return newCue(opts, appContext, f.coreClient, f.cmdRunner, vf) } diff --git a/pkg/template/helm_template.go b/pkg/template/helm_template.go index c5c01ce2d..5039210d0 100644 --- a/pkg/template/helm_template.go +++ b/pkg/template/helm_template.go @@ -9,6 +9,7 @@ import ( "io" "os" goexec "os/exec" + "strings" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" @@ -17,10 +18,11 @@ import ( ) type HelmTemplate struct { - opts v1alpha1.AppTemplateHelmTemplate - appContext AppContext - coreClient kubernetes.Interface - cmdRunner exec.CmdRunner + opts v1alpha1.AppTemplateHelmTemplate + appContext AppContext + coreClient kubernetes.Interface + cmdRunner exec.CmdRunner + valuesFactory ValuesFactory } // HelmTemplateCmdArgs represents the binary and arguments used during templating @@ -31,11 +33,11 @@ type HelmTemplateCmdArgs struct { var _ Template = &HelmTemplate{} -func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, - appContext AppContext, coreClient kubernetes.Interface, - cmdRunner exec.CmdRunner) *HelmTemplate { +func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, coreClient kubernetes.Interface, + cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *HelmTemplate { - return &HelmTemplate{opts, appContext, coreClient, cmdRunner} + return &HelmTemplate{opts: opts, appContext: appContext, coreClient: coreClient, cmdRunner: cmdRunner, + valuesFactory: valuesFactory} } func (t *HelmTemplate) TemplateDir(dirPath string) (exec.CmdRunResult, bool) { @@ -71,8 +73,15 @@ func (t *HelmTemplate) template(dirPath string, input io.Reader) exec.CmdRunResu args := []string{"template", name, chartPath, "--namespace", namespace, "--include-crds"} + if t.opts.KubernetesVersion != nil { + args = append(args, []string{"--kube-version", t.valuesFactory.additionaDownwardAPIValues.KubernetesVersion.String()}...) + } + if t.opts.KubernetesAPIs != nil { + args = append(args, []string{"--api-versions", strings.Join(t.valuesFactory.additionaDownwardAPIValues.KubernetesAPIs, ",")}...) + } + { // Add values files - vals := Values{t.opts.ValuesFrom, t.appContext, t.coreClient} + vals := t.valuesFactory.NewValues(t.opts.ValuesFrom, t.appContext) paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { diff --git a/pkg/template/values.go b/pkg/template/values.go index 1720ba0cb..f7a79082e 100644 --- a/pkg/template/values.go +++ b/pkg/template/values.go @@ -6,7 +6,7 @@ package template import ( "context" "fmt" - "io/ioutil" + "os" "sort" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -18,8 +18,9 @@ import ( type Values struct { ValuesFrom []v1alpha1.AppTemplateValuesSource - appContext AppContext - coreClient kubernetes.Interface + appContext AppContext + coreClient kubernetes.Interface + additionalDownwardAPIValues AdditionalDownwardAPIValues } func (t Values) AsPaths(dirPath string) ([]string, func(), error) { @@ -66,8 +67,9 @@ func (t Values) AsPaths(dirPath string) ([]string, func(), error) { case source.DownwardAPI != nil: downwardAPIValues := DownwardAPIValues{ - items: source.DownwardAPI.Items, - metadata: t.appContext.Metadata, + items: source.DownwardAPI.Items, + metadata: t.appContext.Metadata, + additionalDownwardAPIValues: t.additionalDownwardAPIValues, } paths, err = t.writeFromDownwardAPI(valuesDir.Path(), downwardAPIValues) @@ -134,7 +136,7 @@ func (t Values) writeFile(dstPath, subPath string, content []byte) (string, erro return "", err } - err = ioutil.WriteFile(newPath, content, 0600) + err = os.WriteFile(newPath, content, 0600) if err != nil { return "", fmt.Errorf("Writing file '%s': %s", newPath, err) } diff --git a/pkg/template/values_factory.go b/pkg/template/values_factory.go new file mode 100644 index 000000000..4cad6f589 --- /dev/null +++ b/pkg/template/values_factory.go @@ -0,0 +1,22 @@ +// Copyright 2022 VMware, Inc. +// SPDX-License-Identifier: Apache-2.0 + +package template + +import ( + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "k8s.io/client-go/kubernetes" +) + +// ValuesFactory abstracts the factories for fetching the values away from the template factory +type ValuesFactory struct { + fetchFactory fetch.Factory + coreClient kubernetes.Interface + additionaDownwardAPIValues AdditionalDownwardAPIValues +} + +// NewValues returns a Values struct based on the app template source and the app context +func (vf ValuesFactory) NewValues(valuesFrom []v1alpha1.AppTemplateValuesSource, appContext AppContext) Values { + return Values{ValuesFrom: valuesFrom, appContext: appContext, coreClient: vf.coreClient} +} diff --git a/pkg/template/values_test.go b/pkg/template/values_test.go index f5820bbfc..6c2a87b95 100644 --- a/pkg/template/values_test.go +++ b/pkg/template/values_test.go @@ -8,6 +8,7 @@ import ( "strings" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -209,6 +210,44 @@ func TestValues(t *testing.T) { require.Error(t, err) assert.ErrorContains(t, err, "Writing paths: Invalid field spec provided to DownwardAPI. Only single supported fields are allowed") }) + + t.Run("return kubernetes cluster version if not supplied", func(t *testing.T) { + subject := subject + subject.ValuesFrom = []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{ + Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ + {Name: "k8s-version", KubernetesVersion: &v1alpha1.Version{}}, + }}, + }} + subject.additionalDownwardAPIValues = AdditionalDownwardAPIValues{ + KubernetesVersion: semver.MustParse("0.20.0"), + } + + paths, cleanup, err := subject.AsPaths(os.TempDir()) + require.NoError(t, err) + t.Cleanup(cleanup) + + require.Len(t, paths, 1) + assertFileContents(t, paths[0], "k8s-version: 0.20.0\n") + }) + + t.Run("return kapp-controller version", func(t *testing.T) { + subject := subject + subject.ValuesFrom = []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{ + Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ + {Name: "kc-version", KappControllerVersion: &v1alpha1.Version{}}, + }}, + }} + subject.additionalDownwardAPIValues = AdditionalDownwardAPIValues{ + KappControllerVersion: semver.MustParse("0.42.31337"), + } + + paths, cleanup, err := subject.AsPaths(os.TempDir()) + require.NoError(t, err) + t.Cleanup(cleanup) + + require.Len(t, paths, 1) + assertFileContents(t, paths[0], "kc-version: 0.42.31337\n") + }) }) } diff --git a/pkg/template/ytt.go b/pkg/template/ytt.go index 3e5631df3..3fe5232b2 100644 --- a/pkg/template/ytt.go +++ b/pkg/template/ytt.go @@ -17,20 +17,21 @@ import ( ) type Ytt struct { - opts v1alpha1.AppTemplateYtt - appContext AppContext - coreClient kubernetes.Interface - fetchFactory fetch.Factory - cmdRunner exec.CmdRunner + opts v1alpha1.AppTemplateYtt + appContext AppContext + coreClient kubernetes.Interface + fetchFactory fetch.Factory + valuesFactory ValuesFactory + cmdRunner exec.CmdRunner } var _ Template = &Ytt{} // NewYtt returns ytt template. func NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, - coreClient kubernetes.Interface, fetchFactory fetch.Factory, cmdRunner exec.CmdRunner) *Ytt { + coreClient kubernetes.Interface, fetchFactory fetch.Factory, cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *Ytt { - return &Ytt{opts, appContext, coreClient, fetchFactory, cmdRunner} + return &Ytt{opts: opts, appContext: appContext, coreClient: coreClient, fetchFactory: fetchFactory, cmdRunner: cmdRunner, valuesFactory: valuesFactory} } func (t *Ytt) TemplateDir(dirPath string) (exec.CmdRunResult, bool) { @@ -60,7 +61,7 @@ func (t *Ytt) template(dirPath string, input io.Reader) exec.CmdRunResult { args = t.addFileMarks(args) { // Add values files - vals := Values{t.opts.ValuesFrom, t.appContext, t.coreClient} + vals := t.valuesFactory.NewValues(t.opts.ValuesFrom, t.appContext) paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index eb81845e5..a2e0e37b3 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -132,6 +132,9 @@ spec: fieldPath: metadata.labels['expectedLabel'] - name: allAnnotations fieldPath: metadata.annotations + - name: kubernetesVersion + kubernetesVersion: + version: 1.0.0 deploy: - kapp: {} --- @@ -185,6 +188,7 @@ label: "expectedLabelValue" allAnnotations: expectedAnnotation: expectedAnnotationValue anotherExpectedAnnotation: anotherExpectedAnnotationValue +kubernetesVersion: "1.0.0" `, name, env.Namespace, uid) actual := cm.Data["values"] @@ -250,6 +254,9 @@ spec: fieldPath: metadata.annotations['expectedAnnotation'] - name: label fieldPath: metadata.labels['expectedLabel'] + - name: kubernetesVersion + kubernetesVersion: + version: 1.0.0 deploy: - kapp: {} --- @@ -292,6 +299,7 @@ label: "expectedLabelValue" name: "%s" namespace: "%s" uid: "%s" +kubernetesVersion: "1.0.0" `, name, env.Namespace, uid) configMapData, err := yaml.Marshal(cm.Data) require.NoError(t, err) @@ -337,10 +345,28 @@ spec: {{- range $k, $v := .Values }} {{ $k }}: {{ $v }} {{- end }} + testchart/templates/versions.yaml: | + {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version -}} + apiVersion: v1 + kind: ConfigMap + metadata: + name: k8s-version + annotations: + k8s-version: {{ .Capabilities.KubeVersion.Version }} + {{- end }} + testchart/templates/group-versions-api.yaml: | + {{- if .Capabilities.APIVersions.Has "apps/v1" }} + apiVersion: v1 + kind: ConfigMap + metadata: + name: carvel-group + {{- end }} template: - helmTemplate: path: testchart/ name: testchart + kubernetesVersion: {} + kuberetesAPIs: {} valuesFrom: - secretRef: name: secret-values @@ -408,6 +434,30 @@ uid: "%s" require.NoError(t, err) require.YAMLEq(t, expectedOut, string(actualOut)) }) + + logger.Section("ensuring kubernetes version is templated", func() { + // assume that the presence of the configmap based on semver filtering, then the live k8s version was used + out := kubectl.Run([]string{"get", "configmap", "k8s-version", "-o", "yaml"}) + + var cm corev1.ConfigMap + + err := yaml.Unmarshal([]byte(out), &cm) + if err != nil { + t.Fatalf("Unmarshaling result config map: %s", err) + } + }) + + logger.Section("ensuring kubernetes group/version apis are templated", func() { + // assume that the presence of the configmap based on semver filtering, then the live k8s version was used + out := kubectl.Run([]string{"get", "configmap", "carvel-group", "-o", "yaml"}) + + var cm corev1.ConfigMap + + err := yaml.Unmarshal([]byte(out), &cm) + if err != nil { + t.Fatalf("Unmarshaling result config map: %s", err) + } + }) } func Test_SecretsAndConfigMapsWithCustomPathsCanReconcile(t *testing.T) { From 084e92050fb103d5894edea9837f4c9eb786fe4c Mon Sep 17 00:00:00 2001 From: Neil Hickey Date: Fri, 26 Aug 2022 13:56:30 -0600 Subject: [PATCH 2/8] Fix linter / import statements Signed-off-by: Neil Hickey --- cmd/controller/run.go | 4 +- config/crds.yml | 72 +-- pkg/apis/kappctrl/v1alpha1/generated.pb.go | 492 ++++++++++++------ pkg/apis/kappctrl/v1alpha1/generated.proto | 17 +- pkg/apis/kappctrl/v1alpha1/types_template.go | 19 +- .../v1alpha1/zz_generated.deepcopy.go | 25 +- pkg/apiserver/openapi/zz_generated.openapi.go | 37 +- pkg/app/app.go | 2 +- pkg/app/app_deploy.go | 2 +- pkg/app/app_reconcile_test.go | 4 +- pkg/app/app_test.go | 4 +- pkg/app/crd_app.go | 2 +- pkg/app/reconciler.go | 2 +- pkg/componentInfo/component_info.go | 11 + pkg/deploy/factory.go | 3 +- pkg/deploy/kapp.go | 4 +- pkg/kubeconfig/kubeconfig.go | 8 +- pkg/kubeconfig/kubeconfig_restricted.go | 10 +- pkg/kubeconfig/kubeconfig_secrets.go | 13 +- pkg/kubeconfig/service_accounts.go | 3 + .../packageinstall_deletion_test.go | 2 +- .../packageinstall_downgrade_test.go | 2 +- pkg/packageinstall/packageinstall_test.go | 2 +- pkg/packageinstall/reconciler.go | 2 +- pkg/pkgrepository/app_deploy.go | 2 +- pkg/pkgrepository/app_reconcile_test.go | 2 +- pkg/pkgrepository/app_test.go | 2 +- pkg/pkgrepository/crd_app.go | 1 + pkg/template/downward_api_values.go | 36 +- pkg/template/helm_template.go | 2 + .../kappcontroller/apiserver_protobuf_test.go | 2 +- test/e2e/kappcontroller/config_test.go | 12 +- test/e2e/kappcontroller/package_repo_test.go | 42 +- test/e2e/kappcontroller/template_test.go | 20 + .../private_registry_auth_test.go | 4 +- 35 files changed, 584 insertions(+), 283 deletions(-) diff --git a/cmd/controller/run.go b/cmd/controller/run.go index 1c43f99f2..69fba6b79 100644 --- a/cmd/controller/run.go +++ b/cmd/controller/run.go @@ -6,8 +6,6 @@ package main import ( "context" "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "net/http" // Pprof related _ "net/http/pprof" // Pprof related "os" @@ -19,8 +17,10 @@ import ( pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/app" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" kcconfig "github.com/vmware-tanzu/carvel-kapp-controller/pkg/config" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" pkginstall "github.com/vmware-tanzu/carvel-kapp-controller/pkg/packageinstall" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/pkgrepository" diff --git a/config/crds.yml b/config/crds.yml index cce2190f2..6750ee79e 100644 --- a/config/crds.yml +++ b/config/crds.yml @@ -428,19 +428,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string @@ -502,19 +504,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string @@ -644,19 +648,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string @@ -1033,19 +1039,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string @@ -1107,19 +1115,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string @@ -1249,19 +1259,21 @@ spec: description: 'Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported.' type: string kappControllerVersion: - description: 'Optional: Use kapp-controller version from live cluster' + description: 'Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.' properties: version: type: string type: object kubernetesAPIs: - description: 'Optional: Use kubernetes group/versions resources available in the live cluster' + description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - version: - type: string + groupVersions: + items: + type: string + type: array type: object kubernetesVersion: - description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' + description: 'Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.' properties: version: type: string diff --git a/pkg/apis/kappctrl/v1alpha1/generated.pb.go b/pkg/apis/kappctrl/v1alpha1/generated.pb.go index a4ace6191..d5cc5a990 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.pb.go +++ b/pkg/apis/kappctrl/v1alpha1/generated.pb.go @@ -1011,10 +1011,38 @@ func (m *GenericStatus) XXX_DiscardUnknown() { var xxx_messageInfo_GenericStatus proto.InternalMessageInfo +func (m *GroupVersion) Reset() { *m = GroupVersion{} } +func (*GroupVersion) ProtoMessage() {} +func (*GroupVersion) Descriptor() ([]byte, []int) { + return fileDescriptor_e972ccf085273df7, []int{35} +} +func (m *GroupVersion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GroupVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GroupVersion) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupVersion.Merge(m, src) +} +func (m *GroupVersion) XXX_Size() int { + return m.Size() +} +func (m *GroupVersion) XXX_DiscardUnknown() { + xxx_messageInfo_GroupVersion.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupVersion proto.InternalMessageInfo + func (m *Version) Reset() { *m = Version{} } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_e972ccf085273df7, []int{35} + return fileDescriptor_e972ccf085273df7, []int{36} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1076,6 +1104,7 @@ func init() { proto.RegisterType((*AppTemplateYtt)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppTemplateYtt") proto.RegisterType((*Condition)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Condition") proto.RegisterType((*GenericStatus)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GenericStatus") + proto.RegisterType((*GroupVersion)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GroupVersion") proto.RegisterType((*Version)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Version") } @@ -1084,164 +1113,166 @@ func init() { } var fileDescriptor_e972ccf085273df7 = []byte{ - // 2504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x5d, 0x6c, 0x1b, 0x59, - 0x15, 0xee, 0xc4, 0x4e, 0x1c, 0x9f, 0xfc, 0x34, 0xbd, 0x6d, 0xa8, 0x09, 0x34, 0xae, 0x66, 0xa5, - 0x55, 0x2b, 0xa8, 0xad, 0x46, 0xdd, 0xaa, 0x02, 0x09, 0x29, 0x4e, 0x9a, 0x34, 0x4d, 0xd3, 0x5a, - 0xd7, 0x69, 0xd9, 0x2e, 0xec, 0x76, 0x27, 0xe3, 0x1b, 0x7b, 0xf0, 0x78, 0x66, 0x98, 0xb9, 0xe3, - 0xc6, 0xab, 0x45, 0xe2, 0x4f, 0x68, 0x61, 0x11, 0x54, 0x48, 0x2c, 0x08, 0x24, 0x5e, 0x90, 0x78, - 0x47, 0xf0, 0xb8, 0x2f, 0x08, 0x09, 0x55, 0xe2, 0x65, 0xc5, 0xbe, 0xec, 0x93, 0xa1, 0xe6, 0x89, - 0x47, 0xb4, 0x6f, 0xfb, 0x84, 0xee, 0xcf, 0xfc, 0xd9, 0x4e, 0x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0x7f, 0x59, - 0x79, 0xf4, 0xef, 0xe5, 0x13, 0xaf, 0x4d, 0x07, 0xa6, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x55, 0x7e, 0x86, 0xd2, 0xdf, 0x2b, 0x00, 0x00, + // 2536 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, + 0x15, 0xf6, 0x8a, 0x94, 0x28, 0x3e, 0xfd, 0x58, 0x1e, 0x5b, 0x35, 0xab, 0xd6, 0xa2, 0xb1, 0x01, + 0x02, 0x1b, 0xad, 0x49, 0x58, 0x70, 0x5c, 0xa3, 0x05, 0x0a, 0x88, 0x92, 0x25, 0xcb, 0xb2, 0x6c, + 0x62, 0x28, 0xbb, 0x71, 0xda, 0xc4, 0x59, 0x2d, 0x47, 0xe4, 0x96, 0xcb, 0xdd, 0xed, 0xee, 0x2c, + 0x2d, 0x06, 0x29, 0xd0, 0x3f, 0x14, 0x69, 0x53, 0xb4, 0x46, 0x8b, 0xa6, 0x45, 0x0b, 0xf4, 0x52, + 0xa0, 0xf7, 0xa2, 0x3d, 0xe6, 0x52, 0xf4, 0x62, 0x20, 0x97, 0xa0, 0xb9, 0xe4, 0xc4, 0xd6, 0xec, + 0xa9, 0xc7, 0x22, 0xb7, 0x9c, 0x8a, 0xf9, 0xd9, 0x3f, 0x92, 0x32, 0x15, 0x40, 0xeb, 0x38, 0x40, + 0x6f, 0xbb, 0x33, 0x6f, 0xde, 0xf7, 0xe6, 0xcd, 0x9b, 0xf7, 0xb7, 0x0b, 0xf7, 0x1b, 0x06, 0x6d, + 0xfa, 0x7b, 0x25, 0xdd, 0x6e, 0x97, 0x3b, 0xed, 0x87, 0x9a, 0x4b, 0x2e, 0x51, 0xcd, 0x7a, 0xc3, + 0x2f, 0xeb, 0x9a, 0xdb, 0x21, 0xe6, 0xa5, 0x96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b3, 0x38, 0xc3, + 0x7d, 0x8a, 0x08, 0x8f, 0x61, 0x6e, 0xb2, 0x1e, 0x9f, 0xc4, 0x49, 0xda, 0xf1, 0x71, 0x57, 0xbd, + 0x02, 0x0b, 0x83, 0x37, 0xeb, 0x08, 0xab, 0xde, 0x9d, 0x82, 0xdc, 0xaa, 0xe3, 0xd4, 0x1c, 0xa2, + 0xa3, 0x9b, 0x80, 0x3c, 0xe2, 0x76, 0x0c, 0x9d, 0xac, 0xea, 0xba, 0xed, 0x5b, 0xf4, 0x76, 0xb4, + 0x76, 0x49, 0xae, 0x45, 0xb5, 0x21, 0x0a, 0x3c, 0x62, 0x15, 0x7a, 0x13, 0x72, 0xba, 0xe8, 0xae, + 0xc8, 0xc3, 0xb9, 0x9b, 0x4a, 0x27, 0x48, 0x94, 0xf8, 0xf2, 0x05, 0x07, 0x90, 0xe8, 0x00, 0x26, + 0xf7, 0x99, 0x22, 0x78, 0x5b, 0x62, 0x66, 0xa5, 0x96, 0x82, 0x61, 0x44, 0x2e, 0x81, 0xbf, 0x62, + 0x01, 0x88, 0x7e, 0xa4, 0xc0, 0x34, 0x25, 0x6d, 0xc7, 0xd4, 0x28, 0x29, 0x64, 0x39, 0xfa, 0x31, + 0x17, 0x74, 0xbb, 0x92, 0x7b, 0x65, 0x41, 0x0a, 0x30, 0x1d, 0x8c, 0xe0, 0x10, 0x19, 0xbd, 0x09, + 0x53, 0x75, 0xde, 0x14, 0x28, 0x4c, 0x72, 0x19, 0x76, 0xd3, 0x68, 0x71, 0x44, 0x09, 0xaf, 0x78, + 0xc7, 0x12, 0x93, 0x25, 0xc6, 0x8e, 0xe6, 0x7b, 0xa4, 0xce, 0x2b, 0x98, 0xe9, 0x88, 0xae, 0xca, + 0x47, 0xb1, 0x9c, 0x45, 0x5f, 0x86, 0x69, 0x5d, 0xb3, 0x74, 0x62, 0x92, 0x3a, 0x2f, 0xb2, 0xa6, + 0xa3, 0x3d, 0xad, 0xc9, 0x71, 0x1c, 0x52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d4, 0xf6, 0x20, 0x20, 0x1e, 0x96, 0x01, 0xfd, 0x5c, 0x81, 0xf9, 0x68, 0x74, + 0xb5, 0xba, 0x15, 0x38, 0x85, 0x34, 0xc4, 0x42, 0xfd, 0x5e, 0x71, 0x7e, 0x3b, 0x81, 0x86, 0x07, + 0xd0, 0xd5, 0x33, 0x80, 0x86, 0xdd, 0x98, 0xba, 0x02, 0x27, 0x07, 0x82, 0xd0, 0xd8, 0x0b, 0xac, + 0x7e, 0x8e, 0x57, 0x32, 0x43, 0xde, 0x59, 0xfd, 0xd3, 0x44, 0x82, 0x19, 0x73, 0x4e, 0xe8, 0x00, + 0x32, 0x4e, 0x23, 0xf8, 0x30, 0xf7, 0x6a, 0x7a, 0xfe, 0xb0, 0xba, 0x59, 0x15, 0xae, 0xa9, 0xba, + 0x59, 0xc5, 0x0c, 0x32, 0xda, 0xc6, 0xc4, 0x21, 0x7e, 0xe8, 0x00, 0x32, 0x5a, 0x23, 0x08, 0xa9, + 0x29, 0x8a, 0xb6, 0xda, 0x90, 0x5e, 0x73, 0xb5, 0x41, 0x30, 0x83, 0x54, 0x3f, 0x50, 0x12, 0x67, + 0x21, 0x89, 0xd0, 0xbb, 0x0a, 0x9c, 0x71, 0x5c, 0xa3, 0xc3, 0x94, 0x4a, 0xba, 0x5e, 0x6d, 0xa0, + 0x28, 0xb4, 0x52, 0xd4, 0xde, 0x08, 0xd4, 0x4a, 0xa1, 0xdf, 0x2b, 0x9e, 0x19, 0x35, 0x83, 0x47, + 0x4a, 0x39, 0x6a, 0x57, 0xd5, 0xcd, 0xea, 0x67, 0x7d, 0x57, 0x9b, 0xf0, 0xc2, 0x11, 0xd8, 0x1e, + 0xa1, 0x14, 0xfc, 0xb3, 0x02, 0x5f, 0x1c, 0x72, 0x73, 0xeb, 0xf6, 0x43, 0xeb, 0xa1, 0xe6, 0xd6, + 0x57, 0xab, 0x5b, 0xe8, 0x91, 0x02, 0x93, 0x06, 0x25, 0xed, 0xa0, 0xf5, 0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xbf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x08, 0x9b, 0x4f, 0x72, 0x2d, 0x2c, 0x00, 0x00, } func (m *AppCluster) Marshal() (dAtA []byte, err error) { @@ -3032,6 +3063,38 @@ func (m *GenericStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GroupVersion) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GroupVersion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GroupVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GroupVersions) > 0 { + for iNdEx := len(m.GroupVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GroupVersions[iNdEx]) + copy(dAtA[i:], m.GroupVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GroupVersions[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *Version) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3755,6 +3818,21 @@ func (m *GenericStatus) Size() (n int) { return n } +func (m *GroupVersion) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GroupVersions) > 0 { + for _, s := range m.GroupVersions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *Version) Size() (n int) { if m == nil { return 0 @@ -4169,7 +4247,7 @@ func (this *AppTemplateValuesDownwardAPIItem) String() string { `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, `KappControllerVersion:` + strings.Replace(this.KappControllerVersion.String(), "Version", "Version", 1) + `,`, - `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "Version", "Version", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "GroupVersion", "GroupVersion", 1) + `,`, `}`, }, "") return s @@ -4248,6 +4326,16 @@ func (this *GenericStatus) String() string { }, "") return s } +func (this *GroupVersion) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GroupVersion{`, + `GroupVersions:` + fmt.Sprintf("%v", this.GroupVersions) + `,`, + `}`, + }, "") + return s +} func (this *Version) String() string { if this == nil { return "nil" @@ -8740,7 +8828,7 @@ func (m *AppTemplateValuesDownwardAPIItem) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.KubernetesAPIs == nil { - m.KubernetesAPIs = &Version{} + m.KubernetesAPIs = &GroupVersion{} } if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -9608,6 +9696,88 @@ func (m *GenericStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *GroupVersion) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GroupVersion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GroupVersion: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupVersions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupVersions = append(m.GroupVersions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Version) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/pkg/apis/kappctrl/v1alpha1/generated.proto b/pkg/apis/kappctrl/v1alpha1/generated.proto index 701ffb986..9c826d266 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.proto +++ b/pkg/apis/kappctrl/v1alpha1/generated.proto @@ -395,15 +395,17 @@ message AppTemplateValuesDownwardAPIItem { // Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported. optional string fieldPath = 2; - // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. - // Can be manually overridden to a value instead. + // Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. + // Can be manually supplied instead. optional Version kubernetesVersion = 3; - // Optional: Use kapp-controller version from live cluster + // Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. + // Can be manually supplied instead. optional Version kappControllerVersion = 4; - // Optional: Use kubernetes group/versions resources available in the live cluster - optional Version kubernetesAPIs = 5; + // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. + // Can be manually supplied instead, e.g ["group/version", "group2/version2"] + optional GroupVersion kubernetesAPIs = 5; } // +k8s:openapi-gen=true @@ -480,6 +482,11 @@ message GenericStatus { optional string usefulErrorMessage = 4; } +// +k8s:openapi-gen=true +message GroupVersion { + repeated string groupVersions = 1; +} + // +k8s:openapi-gen=true message Version { optional string version = 1; diff --git a/pkg/apis/kappctrl/v1alpha1/types_template.go b/pkg/apis/kappctrl/v1alpha1/types_template.go index ba53cc6a9..ae5c70407 100644 --- a/pkg/apis/kappctrl/v1alpha1/types_template.go +++ b/pkg/apis/kappctrl/v1alpha1/types_template.go @@ -83,18 +83,25 @@ type AppTemplateValuesDownwardAPIItem struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // Required: Selects a field of the app: only annotations, labels, uid, name and namespace are supported. FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,2,opt,name=fieldPath"` - // Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. - // Can be manually overridden to a value instead. + // Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. + // Can be manually supplied instead. KubernetesVersion *Version `json:"kubernetesVersion,omitempty" protobuf:"bytes,3,opt,name=kubernetesVersion"` - // Optional: Use kapp-controller version from live cluster + // Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. + // Can be manually supplied instead. KappControllerVersion *Version `json:"kappControllerVersion,omitempty" protobuf:"bytes,4,opt,name=kappControllerVersion"` - // Optional: Use kubernetes group/versions resources available in the live cluster - KubernetesAPIs *Version `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` + // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. + // Can be manually supplied instead, e.g ["group/version", "group2/version2"] + KubernetesAPIs *GroupVersion `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true type Version struct { - Version string `json:"version,omitempty" protobut:"bytes,1,opt,version=version" protobuf:"bytes,1,opt,name=version"` + Version string `json:"version,omitempty" protobuf:"bytes,1,opt,name=version"` +} + +// +k8s:openapi-gen=true +type GroupVersion struct { + GroupVersions []string `json:"groupVersions,omitempty" protobuf:"bytes,1,opt,name=groupVersions"` } // TODO implement kustomize diff --git a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go index cda2d3846..68ad4749d 100644 --- a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go @@ -934,8 +934,8 @@ func (in *AppTemplateValuesDownwardAPIItem) DeepCopyInto(out *AppTemplateValuesD } if in.KubernetesAPIs != nil { in, out := &in.KubernetesAPIs, &out.KubernetesAPIs - *out = new(Version) - **out = **in + *out = new(GroupVersion) + (*in).DeepCopyInto(*out) } return } @@ -1098,6 +1098,27 @@ func (in *GenericStatus) DeepCopy() *GenericStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupVersion) DeepCopyInto(out *GroupVersion) { + *out = *in + if in.GroupVersions != nil { + in, out := &in.GroupVersions, &out.GroupVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupVersion. +func (in *GroupVersion) DeepCopy() *GroupVersion { + if in == nil { + return nil + } + out := new(GroupVersion) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KappDeployStatus) DeepCopyInto(out *KappDeployStatus) { *out = *in diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index 23d306990..9fd4ddda0 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -50,6 +50,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSourceRef": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesSourceRef(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateYtt": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateYtt(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Condition": schema_pkg_apis_kappctrl_v1alpha1_Condition(ref), + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion": schema_pkg_apis_kappctrl_v1alpha1_GroupVersion(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version": schema_pkg_apis_kappctrl_v1alpha1_Version(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.AppTemplateSpec": schema_apiserver_apis_datapackaging_v1alpha1_AppTemplateSpec(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.IncludedSoftware": schema_apiserver_apis_datapackaging_v1alpha1_IncludedSoftware(ref), @@ -1367,27 +1368,27 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesDownwardAPIItem(ref comm }, "kubernetesVersion": { SchemaProps: spec.SchemaProps{ - Description: "Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.", + Description: "Optional: Get running Kubernetes version from cluster, defaults (empty) to retrieving the version from the cluster. Can be manually supplied instead.", Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), }, }, "kappControllerVersion": { SchemaProps: spec.SchemaProps{ - Description: "Optional: Use kapp-controller version from live cluster", + Description: "Optional: Get running KappController version, defaults (empty) to retrieving the current running version.. Can be manually supplied instead.", Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), }, }, "kubernetesAPIs": { SchemaProps: spec.SchemaProps{ - Description: "Optional: Use kubernetes group/versions resources available in the live cluster", - Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + Description: "Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g [\"group/version\", \"group2/version2\"]", + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion"), }, }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1563,6 +1564,32 @@ func schema_pkg_apis_kappctrl_v1alpha1_Condition(ref common.ReferenceCallback) c } } +func schema_pkg_apis_kappctrl_v1alpha1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "groupVersions": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_kappctrl_v1alpha1_Version(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/app/app.go b/pkg/app/app.go index 9d5b9ab83..3726c90e5 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -4,11 +4,11 @@ package app import ( - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "sync" "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" diff --git a/pkg/app/app_deploy.go b/pkg/app/app_deploy.go index 9e80d6126..bb5fec26b 100644 --- a/pkg/app/app_deploy.go +++ b/pkg/app/app_deploy.go @@ -5,11 +5,11 @@ package app import ( "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" ctldep "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" ) func (a *App) deploy(tplOutput string, changedFunc func(exec.CmdRunResult)) exec.CmdRunResult { diff --git a/pkg/app/app_reconcile_test.go b/pkg/app/app_reconcile_test.go index bcfc57251..3e22f9862 100644 --- a/pkg/app/app_reconcile_test.go +++ b/pkg/app/app_reconcile_test.go @@ -5,17 +5,17 @@ package app import ( "fmt" - "github.com/k14s/semver/v4" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/fake" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" corev1 "k8s.io/api/core/v1" diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index d06ce8f8d..c0a4924ae 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -4,17 +4,17 @@ package app_test import ( - "github.com/k14s/semver/v4" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" apppkg "github.com/vmware-tanzu/carvel-kapp-controller/pkg/app" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/app/crd_app.go b/pkg/app/crd_app.go index 3d387760e..ef23683c7 100644 --- a/pkg/app/crd_app.go +++ b/pkg/app/crd_app.go @@ -6,12 +6,12 @@ package app import ( "context" "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "reflect" "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" diff --git a/pkg/app/reconciler.go b/pkg/app/reconciler.go index 67955ba46..2a57557df 100644 --- a/pkg/app/reconciler.go +++ b/pkg/app/reconciler.go @@ -6,12 +6,12 @@ package app import ( "context" "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reconciler" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker" corev1 "k8s.io/api/core/v1" diff --git a/pkg/componentInfo/component_info.go b/pkg/componentInfo/component_info.go index ae89ea56e..1141daf52 100644 --- a/pkg/componentInfo/component_info.go +++ b/pkg/componentInfo/component_info.go @@ -1,7 +1,11 @@ +// Copyright 2022 VMware, Inc. +// SPDX-License-Identifier: Apache-2.0 + package componentInfo import ( "fmt" + "github.com/k14s/semver/v4" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" @@ -10,22 +14,26 @@ import ( "k8s.io/client-go/tools/clientcmd" ) +// Info provides information about components of the system type Info interface { KappControllerVersion() (semver.Version, error) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) KubernetesAPIs() ([]string, error) } +// ComponentInfo provides information about components of system type ComponentInfo struct { coreClient kubernetes.Interface clusterAccess *kubeconfig.Kubeconfig kappControllerVersion string } +// NewComponentInfo returns a ComponentInfo func NewComponentInfo(coreClient kubernetes.Interface, clusterAccess *kubeconfig.Kubeconfig, kappControllerVersion string) *ComponentInfo { return &ComponentInfo{coreClient: coreClient, clusterAccess: clusterAccess, kappControllerVersion: kappControllerVersion} } +// KappControllerVersion returns the running KC version func (ci *ComponentInfo) KappControllerVersion() (semver.Version, error) { v, err := semver.ParseTolerant(ci.kappControllerVersion) if err != nil { @@ -34,6 +42,8 @@ func (ci *ComponentInfo) KappControllerVersion() (semver.Version, error) { return v, nil } +// KubernetesVersion returns the running K8s version depending on AppSpec +// If AppSpec points to external cluster, we use that k8s version instead func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { switch { case len(serviceAccountName) > 0: @@ -67,6 +77,7 @@ func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluste } } +// KubernetesAPIs returns the available kubernetes Group/Version resources func (ci *ComponentInfo) KubernetesAPIs() ([]string, error) { groups, err := ci.coreClient.Discovery().ServerGroups() if err != nil { diff --git a/pkg/deploy/factory.go b/pkg/deploy/factory.go index de792f802..a0526e3ec 100644 --- a/pkg/deploy/factory.go +++ b/pkg/deploy/factory.go @@ -4,11 +4,10 @@ package deploy import ( - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" - "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "k8s.io/client-go/kubernetes" ) diff --git a/pkg/deploy/kapp.go b/pkg/deploy/kapp.go index 4d9fd16e6..5762c9cef 100644 --- a/pkg/deploy/kapp.go +++ b/pkg/deploy/kapp.go @@ -7,8 +7,6 @@ import ( "bytes" "errors" "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" - "gopkg.in/yaml.v2" "os" goexec "os/exec" "path/filepath" @@ -17,7 +15,9 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/memdir" + "gopkg.in/yaml.v2" ) const ( diff --git a/pkg/kubeconfig/kubeconfig.go b/pkg/kubeconfig/kubeconfig.go index 0ee7a4f0f..5c4386dc9 100644 --- a/pkg/kubeconfig/kubeconfig.go +++ b/pkg/kubeconfig/kubeconfig.go @@ -5,6 +5,7 @@ package kubeconfig import ( "fmt" + "github.com/go-logr/logr" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "k8s.io/client-go/kubernetes" @@ -13,21 +14,24 @@ import ( // Kubeconfig provides access to the kubernetes cluster // It initializes the service-account token cache type Kubeconfig struct { - kubeconfigSecrets *KubeconfigSecrets + kubeconfigSecrets *Secrets serviceAccounts *ServiceAccounts log logr.Logger } +// AccessLocation contains the name/namespace of the resource which provides cluster access +// for example, a service account has a name and namespace type AccessLocation struct { Name string Namespace string } +// AccessInfo provides a kubernetes kubeconfig for use to access the cluster type AccessInfo struct { Name string Namespace string - Kubeconfig *KubeconfigRestricted + Kubeconfig *Restricted DangerousUsePodServiceAccount bool } diff --git a/pkg/kubeconfig/kubeconfig_restricted.go b/pkg/kubeconfig/kubeconfig_restricted.go index 21ce00fdf..8f11e0d69 100644 --- a/pkg/kubeconfig/kubeconfig_restricted.go +++ b/pkg/kubeconfig/kubeconfig_restricted.go @@ -10,13 +10,14 @@ import ( "sigs.k8s.io/yaml" ) -type KubeconfigRestricted struct { +// Restricted contains a kubernetes kubeconfig as a string +type Restricted struct { result string } // NewKubeconfigRestricted takes kubeconfig yaml as input and returns kubeconfig yaml with certain fields restricted (removed). // Developers may find it informative to view their own config at ~/.kube/config -func NewKubeconfigRestricted(input string) (*KubeconfigRestricted, error) { +func NewKubeconfigRestricted(input string) (*Restricted, error) { var inputConfig clientcmd.Config err := yaml.Unmarshal([]byte(input), &inputConfig) @@ -80,7 +81,8 @@ func NewKubeconfigRestricted(input string) (*KubeconfigRestricted, error) { return nil, fmt.Errorf("Marshaling kubeconfig: %s", err) } - return &KubeconfigRestricted{string(bs)}, nil + return &Restricted{string(bs)}, nil } -func (r *KubeconfigRestricted) AsYAML() string { return r.result } +// AsYAML returns a string formatted kubernetes kubeconfig +func (r *Restricted) AsYAML() string { return r.result } diff --git a/pkg/kubeconfig/kubeconfig_secrets.go b/pkg/kubeconfig/kubeconfig_secrets.go index 06c547b3c..d0fb2c1bf 100644 --- a/pkg/kubeconfig/kubeconfig_secrets.go +++ b/pkg/kubeconfig/kubeconfig_secrets.go @@ -13,15 +13,18 @@ import ( "k8s.io/client-go/kubernetes" ) -type KubeconfigSecrets struct { +// Secrets gets cluster access based on a secret +type Secrets struct { coreClient kubernetes.Interface } -func NewKubeconfigSecrets(coreClient kubernetes.Interface) *KubeconfigSecrets { - return &KubeconfigSecrets{coreClient} +// NewKubeconfigSecrets returns a Secrets +func NewKubeconfigSecrets(coreClient kubernetes.Interface) *Secrets { + return &Secrets{coreClient} } -func (s *KubeconfigSecrets) Find(accessLocation AccessLocation, +// Find takes the location of the credentials secret and returns information to access the cluster +func (s *Secrets) Find(accessLocation AccessLocation, clusterOpts *v1alpha1.AppCluster) (AccessInfo, error) { if clusterOpts == nil { @@ -53,7 +56,7 @@ func (s *KubeconfigSecrets) Find(accessLocation AccessLocation, return pgoForCluster, nil } -func (s *KubeconfigSecrets) fetchKubeconfigYAML(nsName string, +func (s *Secrets) fetchKubeconfigYAML(nsName string, secretRef *v1alpha1.AppClusterKubeconfigSecretRef) (string, error) { if len(nsName) == 0 { diff --git a/pkg/kubeconfig/service_accounts.go b/pkg/kubeconfig/service_accounts.go index 07e07e3bc..7b089e877 100644 --- a/pkg/kubeconfig/service_accounts.go +++ b/pkg/kubeconfig/service_accounts.go @@ -18,6 +18,8 @@ import ( "k8s.io/client-go/kubernetes" ) +// ServiceAccounts gets cluster access based on a serviceaccount +// It provides a tokenManager to cache service account tokens type ServiceAccounts struct { coreClient kubernetes.Interface log logr.Logger @@ -36,6 +38,7 @@ func NewServiceAccounts(coreClient kubernetes.Interface, log logr.Logger) *Servi tokenManager: tokenMgr, caCert: []byte(os.Getenv("KAPPCTRL_KUBERNETES_CA_DATA"))} } +// Find takes the location of the credentials service account and returns information to access the cluster func (s *ServiceAccounts) Find(accessLocation AccessLocation, saName string) (AccessInfo, error) { kubeconfigYAML, err := s.fetchServiceAccount(accessLocation.Namespace, saName) if err != nil { diff --git a/pkg/packageinstall/packageinstall_deletion_test.go b/pkg/packageinstall/packageinstall_deletion_test.go index 907f57f7d..cc087ccb9 100644 --- a/pkg/packageinstall/packageinstall_deletion_test.go +++ b/pkg/packageinstall/packageinstall_deletion_test.go @@ -4,9 +4,9 @@ package packageinstall import ( - "github.com/k14s/semver/v4" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1" diff --git a/pkg/packageinstall/packageinstall_downgrade_test.go b/pkg/packageinstall/packageinstall_downgrade_test.go index a9a3d0e11..bc456ff28 100644 --- a/pkg/packageinstall/packageinstall_downgrade_test.go +++ b/pkg/packageinstall/packageinstall_downgrade_test.go @@ -4,9 +4,9 @@ package packageinstall import ( - "github.com/k14s/semver/v4" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" diff --git a/pkg/packageinstall/packageinstall_test.go b/pkg/packageinstall/packageinstall_test.go index ff08a9057..3a2c2a871 100644 --- a/pkg/packageinstall/packageinstall_test.go +++ b/pkg/packageinstall/packageinstall_test.go @@ -5,10 +5,10 @@ package packageinstall import ( "fmt" - "github.com/k14s/semver/v4" "reflect" "testing" + "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" diff --git a/pkg/packageinstall/reconciler.go b/pkg/packageinstall/reconciler.go index 4bbe50db7..8ecd4458f 100644 --- a/pkg/packageinstall/reconciler.go +++ b/pkg/packageinstall/reconciler.go @@ -6,7 +6,6 @@ package packageinstall import ( "context" "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/go-logr/logr" kappctrlv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -14,6 +13,7 @@ import ( datapkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1" pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/pkg/pkgrepository/app_deploy.go b/pkg/pkgrepository/app_deploy.go index 2c16fa046..b4e29e228 100644 --- a/pkg/pkgrepository/app_deploy.go +++ b/pkg/pkgrepository/app_deploy.go @@ -5,11 +5,11 @@ package pkgrepository import ( "fmt" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" ctldep "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" ) func (a *App) deploy(tplOutput string) exec.CmdRunResult { diff --git a/pkg/pkgrepository/app_reconcile_test.go b/pkg/pkgrepository/app_reconcile_test.go index 9116a759b..42276f563 100644 --- a/pkg/pkgrepository/app_reconcile_test.go +++ b/pkg/pkgrepository/app_reconcile_test.go @@ -4,7 +4,6 @@ package pkgrepository import ( - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "testing" "github.com/stretchr/testify/assert" @@ -14,6 +13,7 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/pkgrepository/app_test.go b/pkg/pkgrepository/app_test.go index fc84cb2c0..a2df407e1 100644 --- a/pkg/pkgrepository/app_test.go +++ b/pkg/pkgrepository/app_test.go @@ -4,7 +4,6 @@ package pkgrepository_test import ( - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "reflect" "testing" @@ -13,6 +12,7 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/pkgrepository/crd_app.go b/pkg/pkgrepository/crd_app.go index be5e63d64..7b2b1acba 100644 --- a/pkg/pkgrepository/crd_app.go +++ b/pkg/pkgrepository/crd_app.go @@ -6,6 +6,7 @@ package pkgrepository import ( "context" "fmt" + "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1" diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 7bd35674d..040ec73f5 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -6,15 +6,16 @@ package template import ( "errors" "fmt" - "github.com/k14s/semver/v4" "regexp" "strings" + "github.com/k14s/semver/v4" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "gopkg.in/yaml.v2" "k8s.io/client-go/util/jsonpath" ) +// AdditionalDownwardAPIValues holds values that are not computed discoverable on the resource itself type AdditionalDownwardAPIValues struct { KappControllerVersion semver.Version KubernetesVersion semver.Version @@ -29,40 +30,51 @@ type DownwardAPIValues struct { additionalDownwardAPIValues AdditionalDownwardAPIValues } -// AsYAMLs returns many key-values queried (using jsonpath) against an object metadata provided. +// AsYAMLs returns many key-values queried (using jsonpath) against an object metadata provided, and use additionalValues. func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { dataValues := [][]byte{} keyValueContent := []byte{} + var err error for _, item := range a.items { - err := a.validateName(item.Name) + err = a.validateName(item.Name) if err != nil { return nil, err } switch { case item.FieldPath != "": - fieldPathExpression, err := relaxedJSONPathExpression(item.FieldPath) + var fieldPathExpression string + fieldPathExpression, err = relaxedJSONPathExpression(item.FieldPath) if err != nil { return nil, err } keyValueContent, err = a.extractFieldPathAsKeyValue(item.Name, fieldPathExpression) - if err != nil { - return nil, err - } case item.KubernetesVersion != nil: - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion.String()}) - if err != nil { - return nil, err + if item.KubernetesVersion.Version == "" { // I wish there was a ternary operator in Go + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion.String()}) + } else { + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KubernetesVersion.Version}) } case item.KappControllerVersion != nil: - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion.String()}) + if item.KappControllerVersion.Version == "" { + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion.String()}) + } else { + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KappControllerVersion.Version}) + } case item.KubernetesAPIs != nil: - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(a.additionalDownwardAPIValues.KubernetesAPIs, ",")}) + if item.KubernetesAPIs.GroupVersions == nil { + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(a.additionalDownwardAPIValues.KubernetesAPIs, ",")}) + } else { + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.GroupVersions, ",")}) + } default: return nil, fmt.Errorf("Invalid downward API item given") } + if err != nil { + return nil, err + } dataValues = append(dataValues, keyValueContent) } diff --git a/pkg/template/helm_template.go b/pkg/template/helm_template.go index 5039210d0..85072d65e 100644 --- a/pkg/template/helm_template.go +++ b/pkg/template/helm_template.go @@ -33,6 +33,7 @@ type HelmTemplateCmdArgs struct { var _ Template = &HelmTemplate{} +// NewHelmTemplate returns a HelmTemplate func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, coreClient kubernetes.Interface, cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *HelmTemplate { @@ -40,6 +41,7 @@ func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContex valuesFactory: valuesFactory} } +// TemplateDir runs helm template against a directory of files func (t *HelmTemplate) TemplateDir(dirPath string) (exec.CmdRunResult, bool) { return t.template(dirPath, nil), true } diff --git a/test/e2e/kappcontroller/apiserver_protobuf_test.go b/test/e2e/kappcontroller/apiserver_protobuf_test.go index edf2236a5..2bd4afcfe 100644 --- a/test/e2e/kappcontroller/apiserver_protobuf_test.go +++ b/test/e2e/kappcontroller/apiserver_protobuf_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "github.com/vmware-tanzu/carvel-kapp-controller/test/e2e" "github.com/stretchr/testify/require" + "github.com/vmware-tanzu/carvel-kapp-controller/test/e2e" ) func TestAPIServerProtobuf(t *testing.T) { diff --git a/test/e2e/kappcontroller/config_test.go b/test/e2e/kappcontroller/config_test.go index d8f66a707..46bdb9971 100644 --- a/test/e2e/kappcontroller/config_test.go +++ b/test/e2e/kappcontroller/config_test.go @@ -4,15 +4,15 @@ package kappcontroller import ( - "testing" + "fmt" "strings" + "testing" "time" - "fmt" - "github.com/stretchr/testify/assert" - "github.com/vmware-tanzu/carvel-kapp-controller/test/e2e" uitest "github.com/cppforlife/go-cli-ui/ui/test" + "github.com/stretchr/testify/assert" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "github.com/vmware-tanzu/carvel-kapp-controller/test/e2e" "sigs.k8s.io/yaml" ) @@ -226,7 +226,7 @@ stringData: logger.Section("deploy app that fetches content from http server", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name}, e2e.RunOpts{ - StdinReader: strings.NewReader(yaml1), + StdinReader: strings.NewReader(yaml1), OnErrKubectl: []string{"get", "app/test-https", "-oyaml"}, }) @@ -250,7 +250,7 @@ spec: ` kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgrName}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgrConfig), + StdinReader: strings.NewReader(pkgrConfig), OnErrKubectl: []string{"get", "pkgr/test-https-pkgr", "-oyaml"}, }) diff --git a/test/e2e/kappcontroller/package_repo_test.go b/test/e2e/kappcontroller/package_repo_test.go index f78154182..0048fe642 100644 --- a/test/e2e/kappcontroller/package_repo_test.go +++ b/test/e2e/kappcontroller/package_repo_test.go @@ -100,7 +100,7 @@ spec: logger.Section("deploy", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name}, e2e.RunOpts{ - StdinReader: strings.NewReader(repoYml), + StdinReader: strings.NewReader(repoYml), OnErrKubectl: []string{"get", "pkgr", "-oyaml"}, }) }) @@ -113,7 +113,7 @@ spec: if err != nil { t.Fatalf("failed to unmarshal: %s", err) } - + expectedStatus := v1alpha1.PackageRepositoryStatus{ Fetch: &kcv1alpha1.AppStatusFetch{ ExitCode: 0, @@ -145,7 +145,7 @@ spec: logger.Section("force a second reconcile and see if it all still works", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name}, e2e.RunOpts{ - StdinReader: strings.NewReader(repoYml+"\n syncPeriod: 30s\n"), + StdinReader: strings.NewReader(repoYml + "\n syncPeriod: 30s\n"), OnErrKubectl: []string{"get", "pkgr", "-oyaml"}, }) }) @@ -186,7 +186,7 @@ spec: out := kubectl.Run([]string{"get", "pkgm/pkg.test.carvel.dev", "-o", "yaml"}) assert.Contains(t, out, "packaging.carvel.dev/package-repository-ref: kappctrl-test/basic.test.carvel.dev") - + verifyPkg("pkg/pkg.test.carvel.dev.1.0.0", "index.docker.io/k8slt/kctrl-example-pkg@sha256:8ffa7f9352149dba1d539d0006b38eda357917edcdd39b82497a61dab2c27b75") verifyPkg("pkg/pkg.test.carvel.dev.2.0.0", "index.docker.io/k8slt/kctrl-example-pkg@sha256:73713d922b5f561c0db2a7ea5f4f6384f7d2d6289886f8400a8aaf5e8fdf134a") }) @@ -371,7 +371,7 @@ spec: logger.Section("deploy pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -379,7 +379,7 @@ spec: logger.Section("deploy pkgr2 successfully, but pkg is still owned by pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr2), + StdinReader: strings.NewReader(pkgr2), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -424,7 +424,7 @@ spec: logger.Section("updated pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1u), + StdinReader: strings.NewReader(pkgr1u), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -434,7 +434,7 @@ spec: logger.Section("update pkgr2 successfully, but pkg is still owned by pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr2u), + StdinReader: strings.NewReader(pkgr2u), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -491,7 +491,7 @@ spec: logger.Section("deploy pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -499,7 +499,7 @@ spec: logger.Section("deploy pkgr2 successfully, but pkg is still owned by pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr2), + StdinReader: strings.NewReader(pkgr2), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -601,7 +601,7 @@ spec: logger.Section("deploy pkgr1 into local namespace", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, pkgr1LocalNS) @@ -609,7 +609,7 @@ spec: logger.Section("deploy pkgr2 into global namespace successfully, but pkg is still owned by pkgr1 in local namespace", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr2), + StdinReader: strings.NewReader(pkgr2), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwnedWithNs(t, kubectl, pkgName, pkgr1LocalNS, pkgr1Name, pkgr1LocalNS) @@ -620,7 +620,7 @@ spec: kapp.Run([]string{"delete", "-a", pkgr1Name}) kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwnedWithNs(t, kubectl, pkgName, pkgr2GlobalNS, pkgr2Name, pkgr2GlobalNS) @@ -683,7 +683,7 @@ spec: logger.Section("deploy pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr1Name, env.Namespace) @@ -691,7 +691,7 @@ spec: logger.Section("deploy pkgr2 successfully, and it overrides bc it has higher revision", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr2Name, pkgName, "2")), + StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr2Name, pkgName, "2")), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr2Name, env.Namespace) @@ -701,7 +701,7 @@ spec: kapp.Run([]string{"delete", "-a", pkgr1Name}) kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr2Name, env.Namespace) @@ -709,7 +709,7 @@ spec: logger.Section("install pkgr with higher revision using .0 suffix (2.0 > 2)", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr3Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr3Name, pkgName, "2.0")), + StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr3Name, pkgName, "2.0")), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr3Name, env.Namespace) @@ -717,7 +717,7 @@ spec: logger.Section("install pkgr with lower revision (2.0 > 1.6.8)", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr4Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr4Name, pkgName, "1.6.8")), + StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr4Name, pkgName, "1.6.8")), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr3Name, env.Namespace) @@ -725,7 +725,7 @@ spec: logger.Section("install pkgr with higher revision (2.1.0 > 2.0)", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr5Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr5Name, pkgName, "2.1.0")), + StdinReader: strings.NewReader(fmt.Sprintf(pkgrTemplate, pkgr5Name, pkgName, "2.1.0")), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) assertPkgOwned(t, kubectl, pkgName, pkgr5Name, env.Namespace) @@ -810,7 +810,7 @@ spec: logger.Section("deploy pkgr1", func() { kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr1Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr1), + StdinReader: strings.NewReader(pkgr1), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) @@ -832,7 +832,7 @@ spec: fmt.Sprintf(pkgTemplate, "contooor.co.uk", "0.22.0")) kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", pkgr2Name}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgr2), + StdinReader: strings.NewReader(pkgr2), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index a2e0e37b3..2f148297f 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -135,6 +135,14 @@ spec: - name: kubernetesVersion kubernetesVersion: version: 1.0.0 + - name: kcVersion + kappControllerVersion: + version: 2.0.0 + - name: k8sAPIs + kubernetesAPIs: + groupVersions: + - "test/test" + - "test2/test2" deploy: - kapp: {} --- @@ -189,6 +197,8 @@ allAnnotations: expectedAnnotation: expectedAnnotationValue anotherExpectedAnnotation: anotherExpectedAnnotationValue kubernetesVersion: "1.0.0" +kcVersion: "2.0.0" +k8sAPIs: "test/test,test2/test2" `, name, env.Namespace, uid) actual := cm.Data["values"] @@ -257,6 +267,14 @@ spec: - name: kubernetesVersion kubernetesVersion: version: 1.0.0 + - name: kcVersion + kappControllerVersion: + version: 2.0.0 + - name: k8sAPIs + kubernetesAPIs: + groupVersions: + - "test/test" + - "test2/test2" deploy: - kapp: {} --- @@ -300,6 +318,8 @@ name: "%s" namespace: "%s" uid: "%s" kubernetesVersion: "1.0.0" +kcVersion: "2.0.0" +k8sAPIs: "test/test,test2/test2" `, name, env.Namespace, uid) configMapData, err := yaml.Marshal(cm.Data) require.NoError(t, err) diff --git a/test/e2e/secretgencontroller/private_registry_auth_test.go b/test/e2e/secretgencontroller/private_registry_auth_test.go index fbdac9a03..b84eb8997 100644 --- a/test/e2e/secretgencontroller/private_registry_auth_test.go +++ b/test/e2e/secretgencontroller/private_registry_auth_test.go @@ -226,7 +226,7 @@ spec: `, env.Namespace, pkgiName, registryNamespace) + sas.ForNamespaceYAML() kapp.RunWithOpts([]string{"deploy", "-a", pkgiName, "-f", "-"}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgiYaml), + StdinReader: strings.NewReader(pkgiYaml), OnErrKubectl: []string{"get", "app", "placeholder-private-auth", "-oyaml"}, }) @@ -250,7 +250,7 @@ spec: `, env.Namespace, pkgrName, registryNamespace) + sas.ForNamespaceYAML() kapp.RunWithOpts([]string{"deploy", "-a", pkgrName, "-f", "-"}, e2e.RunOpts{ - StdinReader: strings.NewReader(pkgrYaml), + StdinReader: strings.NewReader(pkgrYaml), OnErrKubectl: []string{"get", "pkgr", "-A", "-oyaml"}, }) From e2dc9c7c40c6cc6f8e1dd86762ed16770b76322e Mon Sep 17 00:00:00 2001 From: Neil Hickey Date: Tue, 30 Aug 2022 17:19:54 -0600 Subject: [PATCH 3/8] Address review comments - renaming some things - moved away from a values factory back to values struct - minor fixups Signed-off-by: Neil Hickey --- cmd/controller/run.go | 4 +-- pkg/app/app.go | 14 +++++++-- pkg/app/app_factory.go | 3 +- pkg/app/app_template.go | 2 +- pkg/app/crd_app.go | 3 +- pkg/app/reconciler.go | 5 ++-- .../component_info.go | 29 +++++++++++-------- pkg/deploy/kapp.go | 2 +- pkg/packageinstall/packageinstall.go | 11 +++++-- .../packageinstall_deletion_test.go | 5 ---- pkg/packageinstall/reconciler.go | 5 ++-- pkg/template/cue.go | 17 ++++++----- pkg/template/downward_api_values.go | 9 +++--- pkg/template/factory.go | 29 ++++--------------- pkg/template/helm_template.go | 24 +++++++-------- pkg/template/values.go | 10 +++---- pkg/template/values_factory.go | 22 -------------- pkg/template/values_test.go | 9 +++--- pkg/template/ytt.go | 18 ++++++------ 19 files changed, 95 insertions(+), 126 deletions(-) rename pkg/{componentInfo => componentinfo}/component_info.go (83%) delete mode 100644 pkg/template/values_factory.go diff --git a/cmd/controller/run.go b/cmd/controller/run.go index 69fba6b79..568b3a385 100644 --- a/cmd/controller/run.go +++ b/cmd/controller/run.go @@ -17,7 +17,7 @@ import ( pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/app" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentinfo" kcconfig "github.com/vmware-tanzu/carvel-kapp-controller/pkg/config" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" @@ -173,7 +173,7 @@ func Run(opts Options, runLog logr.Logger) error { // initialize cluster access once - it contains a service account token cache which should be only setup once. kubeconf := kubeconfig.NewKubeconfig(coreClient, runLog) - compInfo := componentInfo.NewComponentInfo(coreClient, kubeconf, Version) + compInfo := componentinfo.NewComponentInfo(coreClient, kubeconf, Version) { // add controller for apps appFactory := app.CRDAppFactory{ diff --git a/pkg/app/app.go b/pkg/app/app.go index 3726c90e5..198bb62d1 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -7,16 +7,24 @@ import ( "sync" "github.com/go-logr/logr" + "github.com/k14s/semver/v4" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" ) +// ComponentInfo provides information about components of the system required by templating stage +type ComponentInfo interface { + KappControllerVersion() (semver.Version, error) + KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) + KubernetesAPIs() ([]string, error) +} + type Hooks struct { BlockDeletion func() error UnblockDeletion func() error @@ -32,7 +40,7 @@ type App struct { fetchFactory fetch.Factory templateFactory template.Factory deployFactory deploy.Factory - compInfo componentInfo.Info + compInfo ComponentInfo log logr.Logger appMetrics *metrics.AppMetrics @@ -44,7 +52,7 @@ type App struct { func NewApp(app v1alpha1.App, hooks Hooks, fetchFactory fetch.Factory, templateFactory template.Factory, - deployFactory deploy.Factory, log logr.Logger, appMetrics *metrics.AppMetrics, compInfo componentInfo.Info) *App { + deployFactory deploy.Factory, log logr.Logger, appMetrics *metrics.AppMetrics, compInfo ComponentInfo) *App { return &App{app: app, appPrev: *(app.DeepCopy()), hooks: hooks, fetchFactory: fetchFactory, templateFactory: templateFactory, diff --git a/pkg/app/app_factory.go b/pkg/app/app_factory.go index d2acf26d6..e0f2c1f5a 100644 --- a/pkg/app/app_factory.go +++ b/pkg/app/app_factory.go @@ -7,7 +7,6 @@ import ( "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/config" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" @@ -29,7 +28,7 @@ type CRDAppFactory struct { KbldAllowBuild bool CmdRunner exec.CmdRunner Kubeconf *kubeconfig.Kubeconfig - CompInfo componentInfo.Info + CompInfo ComponentInfo } // NewCRDApp creates a CRDApp injecting necessary dependencies. diff --git a/pkg/app/app_template.go b/pkg/app/app_template.go index 4b90b014e..83fe5bed9 100644 --- a/pkg/app/app_template.go +++ b/pkg/app/app_template.go @@ -44,7 +44,7 @@ func (a *App) template(dirPath string) exec.CmdRunResult { return result } - additionalValues := ctltpl.AdditionalDownwardAPIValues{KubernetesVersion: kubernetesVersion, KappControllerVersion: kappControllerVersion, KubernetesAPIs: k8sAPIs} + additionalValues := ctltpl.AdditionalDownwardAPIValues{KubernetesVersion: kubernetesVersion.String(), KappControllerVersion: kappControllerVersion.String(), KubernetesAPIs: k8sAPIs} for _, tpl := range a.app.Spec.Template { var template ctltpl.Template diff --git a/pkg/app/crd_app.go b/pkg/app/crd_app.go index ef23683c7..d983cfde7 100644 --- a/pkg/app/crd_app.go +++ b/pkg/app/crd_app.go @@ -11,7 +11,6 @@ import ( "github.com/go-logr/logr" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" @@ -32,7 +31,7 @@ type CRDApp struct { // NewCRDApp creates new CRD app func NewCRDApp(appModel *kcv1alpha1.App, log logr.Logger, appMetrics *metrics.AppMetrics, appClient kcclient.Interface, fetchFactory fetch.Factory, - templateFactory template.Factory, deployFactory deploy.Factory, compInfo componentInfo.Info) *CRDApp { + templateFactory template.Factory, deployFactory deploy.Factory, compInfo ComponentInfo) *CRDApp { crdApp := &CRDApp{appModel: appModel, log: log, appMetrics: appMetrics, appClient: appClient} diff --git a/pkg/app/reconciler.go b/pkg/app/reconciler.go index 2a57557df..db454360d 100644 --- a/pkg/app/reconciler.go +++ b/pkg/app/reconciler.go @@ -11,7 +11,6 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reconciler" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker" corev1 "k8s.io/api/core/v1" @@ -30,12 +29,12 @@ type Reconciler struct { crdAppFactory CRDAppFactory appRefTracker *reftracker.AppRefTracker appUpdateStatus *reftracker.AppUpdateStatus - componentInfo componentInfo.Info + componentInfo ComponentInfo } // NewReconciler constructs new Reconciler. func NewReconciler(appClient kcclient.Interface, log logr.Logger, crdAppFactory CRDAppFactory, - appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus, componentInfo componentInfo.Info) *Reconciler { + appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus, componentInfo ComponentInfo) *Reconciler { return &Reconciler{appClient: appClient, log: log, crdAppFactory: crdAppFactory, diff --git a/pkg/componentInfo/component_info.go b/pkg/componentinfo/component_info.go similarity index 83% rename from pkg/componentInfo/component_info.go rename to pkg/componentinfo/component_info.go index 1141daf52..d58469900 100644 --- a/pkg/componentInfo/component_info.go +++ b/pkg/componentinfo/component_info.go @@ -1,7 +1,7 @@ // Copyright 2022 VMware, Inc. // SPDX-License-Identifier: Apache-2.0 -package componentInfo +package componentinfo import ( "fmt" @@ -14,18 +14,12 @@ import ( "k8s.io/client-go/tools/clientcmd" ) -// Info provides information about components of the system -type Info interface { - KappControllerVersion() (semver.Version, error) - KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) - KubernetesAPIs() ([]string, error) -} - // ComponentInfo provides information about components of system type ComponentInfo struct { - coreClient kubernetes.Interface - clusterAccess *kubeconfig.Kubeconfig - kappControllerVersion string + coreClient kubernetes.Interface + clusterAccess *kubeconfig.Kubeconfig + kappControllerVersion string + memoizedKubernetesVersion semver.Version } // NewComponentInfo returns a ComponentInfo @@ -47,11 +41,22 @@ func (ci *ComponentInfo) KappControllerVersion() (semver.Version, error) { func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { switch { case len(serviceAccountName) > 0: + if !ci.memoizedKubernetesVersion.Equals(semver.Version{}) { + return ci.memoizedKubernetesVersion, nil + } + v, err := ci.coreClient.Discovery().ServerVersion() if err != nil { return semver.Version{}, err } - return semver.ParseTolerant(v.String()) + + version, err := semver.ParseTolerant(v.String()) + if err != nil { + return semver.Version{}, err + } + + ci.memoizedKubernetesVersion = version + return version, nil case specCluster != nil: accessInfo, err := ci.clusterAccess.ClusterAccess(serviceAccountName, specCluster, kubeconfig.AccessLocation{Name: objMeta.Name, Namespace: objMeta.Namespace}) if err != nil { diff --git a/pkg/deploy/kapp.go b/pkg/deploy/kapp.go index 5762c9cef..44f3f6966 100644 --- a/pkg/deploy/kapp.go +++ b/pkg/deploy/kapp.go @@ -17,7 +17,7 @@ import ( "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/memdir" - "gopkg.in/yaml.v2" + "sigs.k8s.io/yaml" ) const ( diff --git a/pkg/packageinstall/packageinstall.go b/pkg/packageinstall/packageinstall.go index 467e7f47f..0d28d83be 100644 --- a/pkg/packageinstall/packageinstall.go +++ b/pkg/packageinstall/packageinstall.go @@ -16,7 +16,6 @@ import ( pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned/scheme" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/reconciler" "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions" verv1alpha1 "github.com/vmware-tanzu/carvel-vendir/pkg/vendir/versions/v1alpha1" @@ -30,6 +29,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" ) +// ComponentInfo provides information about components of the system required by a PKGI +type ComponentInfo interface { + KappControllerVersion() (semver.Version, error) + KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) +} + const ( // DowngradableAnnKey specifies annotation that user can place on // PackageInstall to indicate that lower version of the package @@ -46,11 +51,11 @@ type PackageInstallCR struct { kcclient kcclient.Interface pkgclient pkgclient.Interface coreClient kubernetes.Interface - compInfo componentInfo.Info + compInfo ComponentInfo } func NewPackageInstallCR(model *pkgingv1alpha1.PackageInstall, log logr.Logger, - kcclient kcclient.Interface, pkgclient pkgclient.Interface, coreClient kubernetes.Interface, compInfo componentInfo.Info) *PackageInstallCR { + kcclient kcclient.Interface, pkgclient pkgclient.Interface, coreClient kubernetes.Interface, compInfo ComponentInfo) *PackageInstallCR { return &PackageInstallCR{model: model, unmodifiedModel: model.DeepCopy(), log: log, kcclient: kcclient, pkgclient: pkgclient, coreClient: coreClient, compInfo: compInfo} diff --git a/pkg/packageinstall/packageinstall_deletion_test.go b/pkg/packageinstall/packageinstall_deletion_test.go index cc087ccb9..916b7b043 100644 --- a/pkg/packageinstall/packageinstall_deletion_test.go +++ b/pkg/packageinstall/packageinstall_deletion_test.go @@ -81,11 +81,6 @@ func Test_PackageInstallDeletion(t *testing.T) { type FakeComponentInfo struct { KCVersion semver.Version K8sVersion semver.Version - K8sAPIs []string -} - -func (f FakeComponentInfo) KubernetesAPIs() ([]string, error) { - return f.K8sAPIs, nil } func (f FakeComponentInfo) KappControllerVersion() (semver.Version, error) { diff --git a/pkg/packageinstall/reconciler.go b/pkg/packageinstall/reconciler.go index 8ecd4458f..367d0270f 100644 --- a/pkg/packageinstall/reconciler.go +++ b/pkg/packageinstall/reconciler.go @@ -13,7 +13,6 @@ import ( datapkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1" pkgclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/client/clientset/versioned" kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/componentInfo" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -29,14 +28,14 @@ type Reconciler struct { pkgClient pkgclient.Interface coreClient kubernetes.Interface pkgToPkgInstallHandler *PackageInstallVersionHandler - compInfo componentInfo.Info + compInfo ComponentInfo log logr.Logger } // NewReconciler is the constructor for the Reconciler struct func NewReconciler(kcClient kcclient.Interface, pkgClient pkgclient.Interface, coreClient kubernetes.Interface, pkgToPkgInstallHandler *PackageInstallVersionHandler, - log logr.Logger, compInfo componentInfo.Info) *Reconciler { + log logr.Logger, compInfo ComponentInfo) *Reconciler { return &Reconciler{kcClient: kcClient, pkgClient: pkgClient, diff --git a/pkg/template/cue.go b/pkg/template/cue.go index 286f6cae3..66f5ea572 100644 --- a/pkg/template/cue.go +++ b/pkg/template/cue.go @@ -16,20 +16,20 @@ import ( ) type cue struct { - opts v1alpha1.AppTemplateCue - coreClient kubernetes.Interface - appContext AppContext - cmdRunner exec.CmdRunner - valuesFactory ValuesFactory + opts v1alpha1.AppTemplateCue + coreClient kubernetes.Interface + appContext AppContext + cmdRunner exec.CmdRunner + additionalValues AdditionalDownwardAPIValues } var _ Template = &cue{} func newCue(opts v1alpha1.AppTemplateCue, appContext AppContext, - coreClient kubernetes.Interface, cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *cue { + coreClient kubernetes.Interface, cmdRunner exec.CmdRunner, additionalValues AdditionalDownwardAPIValues) *cue { return &cue{opts: opts, appContext: appContext, - coreClient: coreClient, cmdRunner: cmdRunner, valuesFactory: valuesFactory} + coreClient: coreClient, cmdRunner: cmdRunner, additionalValues: additionalValues} } // TemplateDir works on directory returning templating result, @@ -60,7 +60,8 @@ func (c *cue) template(dirPath string, input io.Reader) exec.CmdRunResult { args = append(args, c.opts.Paths...) } - vals := c.valuesFactory.NewValues(c.opts.ValuesFrom, c.appContext) + vals := Values{c.opts.ValuesFrom, c.additionalValues, c.appContext, c.coreClient} + paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { return exec.NewCmdRunResultWithErr(fmt.Errorf("Writing values: %w", err)) diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 040ec73f5..6c45712be 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -9,7 +9,6 @@ import ( "regexp" "strings" - "github.com/k14s/semver/v4" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" "gopkg.in/yaml.v2" "k8s.io/client-go/util/jsonpath" @@ -17,8 +16,8 @@ import ( // AdditionalDownwardAPIValues holds values that are not computed discoverable on the resource itself type AdditionalDownwardAPIValues struct { - KappControllerVersion semver.Version - KubernetesVersion semver.Version + KappControllerVersion string + KubernetesVersion string KubernetesAPIs []string } @@ -52,13 +51,13 @@ func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { keyValueContent, err = a.extractFieldPathAsKeyValue(item.Name, fieldPathExpression) case item.KubernetesVersion != nil: if item.KubernetesVersion.Version == "" { // I wish there was a ternary operator in Go - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion.String()}) + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion}) } else { keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KubernetesVersion.Version}) } case item.KappControllerVersion != nil: if item.KappControllerVersion.Version == "" { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion.String()}) + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion}) } else { keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KappControllerVersion.Version}) } diff --git a/pkg/template/factory.go b/pkg/template/factory.go index fc38e178f..e49e3b91c 100644 --- a/pkg/template/factory.go +++ b/pkg/template/factory.go @@ -26,14 +26,8 @@ func NewFactory(coreClient kubernetes.Interface, fetchFactory fetch.Factory, } // NewYtt returns ytt template. -func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) *Ytt { - vf := ValuesFactory{ - fetchFactory: f.fetchFactory, - coreClient: f.coreClient, - additionaDownwardAPIValues: additionalDownwardAPIValues, - } - - return NewYtt(opts, appContext, f.coreClient, f.fetchFactory, f.cmdRunner, vf) +func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, additionalValues AdditionalDownwardAPIValues) *Ytt { + return NewYtt(opts, appContext, f.coreClient, f.fetchFactory, f.cmdRunner, additionalValues) } // NewKbld returns kbld template. @@ -43,14 +37,8 @@ func (f Factory) NewKbld(opts v1alpha1.AppTemplateKbld, appContext AppContext) * // NewHelmTemplate returns helm template. func (f Factory) NewHelmTemplate( - opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) *HelmTemplate { - vf := ValuesFactory{ - fetchFactory: f.fetchFactory, - coreClient: f.coreClient, - additionaDownwardAPIValues: additionalDownwardAPIValues, - } - - return NewHelmTemplate(opts, appContext, f.coreClient, f.cmdRunner, vf) + opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, additionalValues AdditionalDownwardAPIValues) *HelmTemplate { + return NewHelmTemplate(opts, appContext, f.coreClient, f.cmdRunner, additionalValues) } func (f Factory) NewSops( @@ -59,11 +47,6 @@ func (f Factory) NewSops( } // NewCue returns a Cue templater -func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext, additionalDownwardAPIValues AdditionalDownwardAPIValues) Template { - vf := ValuesFactory{ - fetchFactory: f.fetchFactory, - coreClient: f.coreClient, - additionaDownwardAPIValues: additionalDownwardAPIValues, - } - return newCue(opts, appContext, f.coreClient, f.cmdRunner, vf) +func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext, additionalValues AdditionalDownwardAPIValues) Template { + return newCue(opts, appContext, f.coreClient, f.cmdRunner, additionalValues) } diff --git a/pkg/template/helm_template.go b/pkg/template/helm_template.go index 85072d65e..9235f8664 100644 --- a/pkg/template/helm_template.go +++ b/pkg/template/helm_template.go @@ -18,11 +18,11 @@ import ( ) type HelmTemplate struct { - opts v1alpha1.AppTemplateHelmTemplate - appContext AppContext - coreClient kubernetes.Interface - cmdRunner exec.CmdRunner - valuesFactory ValuesFactory + opts v1alpha1.AppTemplateHelmTemplate + appContext AppContext + coreClient kubernetes.Interface + cmdRunner exec.CmdRunner + additionalValues AdditionalDownwardAPIValues } // HelmTemplateCmdArgs represents the binary and arguments used during templating @@ -35,10 +35,10 @@ var _ Template = &HelmTemplate{} // NewHelmTemplate returns a HelmTemplate func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, coreClient kubernetes.Interface, - cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *HelmTemplate { + cmdRunner exec.CmdRunner, additionalValues AdditionalDownwardAPIValues) *HelmTemplate { return &HelmTemplate{opts: opts, appContext: appContext, coreClient: coreClient, cmdRunner: cmdRunner, - valuesFactory: valuesFactory} + additionalValues: additionalValues} } // TemplateDir runs helm template against a directory of files @@ -74,17 +74,17 @@ func (t *HelmTemplate) template(dirPath string, input io.Reader) exec.CmdRunResu } args := []string{"template", name, chartPath, "--namespace", namespace, "--include-crds"} + vals := Values{t.opts.ValuesFrom, t.additionalValues, t.appContext, t.coreClient} if t.opts.KubernetesVersion != nil { - args = append(args, []string{"--kube-version", t.valuesFactory.additionaDownwardAPIValues.KubernetesVersion.String()}...) + // vals.DownwardAPI.KubernetesVersion() + args = append(args, []string{"--kube-version", vals.AdditionalValues.KubernetesVersion}...) } if t.opts.KubernetesAPIs != nil { - args = append(args, []string{"--api-versions", strings.Join(t.valuesFactory.additionaDownwardAPIValues.KubernetesAPIs, ",")}...) + args = append(args, []string{"--api-versions", strings.Join(vals.AdditionalValues.KubernetesAPIs, ",")}...) } - { // Add values files - vals := t.valuesFactory.NewValues(t.opts.ValuesFrom, t.appContext) - + { paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { return exec.NewCmdRunResultWithErr(err) diff --git a/pkg/template/values.go b/pkg/template/values.go index f7a79082e..4079718ce 100644 --- a/pkg/template/values.go +++ b/pkg/template/values.go @@ -16,11 +16,11 @@ import ( ) type Values struct { - ValuesFrom []v1alpha1.AppTemplateValuesSource + ValuesFrom []v1alpha1.AppTemplateValuesSource + AdditionalValues AdditionalDownwardAPIValues - appContext AppContext - coreClient kubernetes.Interface - additionalDownwardAPIValues AdditionalDownwardAPIValues + appContext AppContext + coreClient kubernetes.Interface } func (t Values) AsPaths(dirPath string) ([]string, func(), error) { @@ -69,7 +69,7 @@ func (t Values) AsPaths(dirPath string) ([]string, func(), error) { downwardAPIValues := DownwardAPIValues{ items: source.DownwardAPI.Items, metadata: t.appContext.Metadata, - additionalDownwardAPIValues: t.additionalDownwardAPIValues, + additionalDownwardAPIValues: t.AdditionalValues, } paths, err = t.writeFromDownwardAPI(valuesDir.Path(), downwardAPIValues) diff --git a/pkg/template/values_factory.go b/pkg/template/values_factory.go deleted file mode 100644 index 4cad6f589..000000000 --- a/pkg/template/values_factory.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 VMware, Inc. -// SPDX-License-Identifier: Apache-2.0 - -package template - -import ( - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" - "k8s.io/client-go/kubernetes" -) - -// ValuesFactory abstracts the factories for fetching the values away from the template factory -type ValuesFactory struct { - fetchFactory fetch.Factory - coreClient kubernetes.Interface - additionaDownwardAPIValues AdditionalDownwardAPIValues -} - -// NewValues returns a Values struct based on the app template source and the app context -func (vf ValuesFactory) NewValues(valuesFrom []v1alpha1.AppTemplateValuesSource, appContext AppContext) Values { - return Values{ValuesFrom: valuesFrom, appContext: appContext, coreClient: vf.coreClient} -} diff --git a/pkg/template/values_test.go b/pkg/template/values_test.go index 6c2a87b95..61c044866 100644 --- a/pkg/template/values_test.go +++ b/pkg/template/values_test.go @@ -8,7 +8,6 @@ import ( "strings" "testing" - "github.com/k14s/semver/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" @@ -218,8 +217,8 @@ func TestValues(t *testing.T) { {Name: "k8s-version", KubernetesVersion: &v1alpha1.Version{}}, }}, }} - subject.additionalDownwardAPIValues = AdditionalDownwardAPIValues{ - KubernetesVersion: semver.MustParse("0.20.0"), + subject.AdditionalValues = AdditionalDownwardAPIValues{ + KubernetesVersion: "0.20.0", } paths, cleanup, err := subject.AsPaths(os.TempDir()) @@ -237,8 +236,8 @@ func TestValues(t *testing.T) { {Name: "kc-version", KappControllerVersion: &v1alpha1.Version{}}, }}, }} - subject.additionalDownwardAPIValues = AdditionalDownwardAPIValues{ - KappControllerVersion: semver.MustParse("0.42.31337"), + subject.AdditionalValues = AdditionalDownwardAPIValues{ + KappControllerVersion: "0.42.31337", } paths, cleanup, err := subject.AsPaths(os.TempDir()) diff --git a/pkg/template/ytt.go b/pkg/template/ytt.go index 3fe5232b2..12d135bb2 100644 --- a/pkg/template/ytt.go +++ b/pkg/template/ytt.go @@ -17,21 +17,21 @@ import ( ) type Ytt struct { - opts v1alpha1.AppTemplateYtt - appContext AppContext - coreClient kubernetes.Interface - fetchFactory fetch.Factory - valuesFactory ValuesFactory - cmdRunner exec.CmdRunner + opts v1alpha1.AppTemplateYtt + appContext AppContext + coreClient kubernetes.Interface + fetchFactory fetch.Factory + additionalValues AdditionalDownwardAPIValues + cmdRunner exec.CmdRunner } var _ Template = &Ytt{} // NewYtt returns ytt template. func NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, - coreClient kubernetes.Interface, fetchFactory fetch.Factory, cmdRunner exec.CmdRunner, valuesFactory ValuesFactory) *Ytt { + coreClient kubernetes.Interface, fetchFactory fetch.Factory, cmdRunner exec.CmdRunner, additionalValues AdditionalDownwardAPIValues) *Ytt { - return &Ytt{opts: opts, appContext: appContext, coreClient: coreClient, fetchFactory: fetchFactory, cmdRunner: cmdRunner, valuesFactory: valuesFactory} + return &Ytt{opts: opts, appContext: appContext, coreClient: coreClient, fetchFactory: fetchFactory, cmdRunner: cmdRunner, additionalValues: additionalValues} } func (t *Ytt) TemplateDir(dirPath string) (exec.CmdRunResult, bool) { @@ -61,7 +61,7 @@ func (t *Ytt) template(dirPath string, input io.Reader) exec.CmdRunResult { args = t.addFileMarks(args) { // Add values files - vals := t.valuesFactory.NewValues(t.opts.ValuesFrom, t.appContext) + vals := Values{t.opts.ValuesFrom, t.additionalValues, t.appContext, t.coreClient} paths, valuesCleanUpFunc, err := vals.AsPaths(dirPath) if err != nil { From efcd0389fabb9df4dec684547346a85a89b1d61d Mon Sep 17 00:00:00 2001 From: Neil Hickey Date: Thu, 1 Sep 2022 12:32:09 -0600 Subject: [PATCH 4/8] Fixup errors in app_template Signed-off-by: Neil Hickey --- pkg/app/app_template.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/app/app_template.go b/pkg/app/app_template.go index 83fe5bed9..52c5c278d 100644 --- a/pkg/app/app_template.go +++ b/pkg/app/app_template.go @@ -28,19 +28,19 @@ func (a *App) template(dirPath string) exec.CmdRunResult { kubernetesVersion, err := a.compInfo.KubernetesVersion(a.app.Spec.ServiceAccountName, a.app.Spec.Cluster, &a.app.ObjectMeta) if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes version before templating")) + result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes version before templating: %s", err)) return result } kappControllerVersion, err := a.compInfo.KappControllerVersion() if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to get kapp-controller version before templating")) + result.AttachErrorf("%s", fmt.Errorf("Unable to get kapp-controller version before templating: %s", err)) return result } k8sAPIs, err := a.compInfo.KubernetesAPIs() if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to list all server apigroups/version before templating")) + result.AttachErrorf("%s", fmt.Errorf("Unable to list all server apigroups/version before templating: %s", err)) return result } From 7f0abc21c5af94472896dc97e0dfa86ccbc93683 Mon Sep 17 00:00:00 2001 From: Neil Hickey Date: Fri, 2 Sep 2022 11:16:51 -0600 Subject: [PATCH 5/8] Add memoized fetching of versions - Add template() test to validate memoizing works Signed-off-by: Neil Hickey --- config/crds.yml | 24 +- pkg/apis/kappctrl/v1alpha1/generated.pb.go | 388 +++++++++--------- pkg/apis/kappctrl/v1alpha1/generated.proto | 8 +- pkg/apis/kappctrl/v1alpha1/types_template.go | 8 +- .../v1alpha1/zz_generated.deepcopy.go | 34 +- pkg/apiserver/openapi/zz_generated.openapi.go | 14 +- pkg/app/app.go | 3 + pkg/app/app_reconcile_test.go | 12 +- pkg/app/app_template.go | 52 ++- pkg/app/app_template_test.go | 74 ++++ pkg/packageinstall/packageinstall.go | 13 +- pkg/template/downward_api_values.go | 28 +- pkg/template/helm_template.go | 18 +- pkg/template/values_test.go | 8 +- test/e2e/kappcontroller/template_test.go | 4 +- 15 files changed, 413 insertions(+), 275 deletions(-) create mode 100644 pkg/app/app_template_test.go diff --git a/config/crds.yml b/config/crds.yml index 6750ee79e..70defd5eb 100644 --- a/config/crds.yml +++ b/config/crds.yml @@ -436,7 +436,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array @@ -468,8 +468,10 @@ spec: kubernetesAPIs: description: 'Optional: Use kubernetes group/versions resources available in the live cluster' properties: - version: - type: string + kubernetesGroupVersions: + items: + type: string + type: array type: object kubernetesVersion: description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' @@ -512,7 +514,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array @@ -656,7 +658,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array @@ -1047,7 +1049,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array @@ -1079,8 +1081,10 @@ spec: kubernetesAPIs: description: 'Optional: Use kubernetes group/versions resources available in the live cluster' properties: - version: - type: string + kubernetesGroupVersions: + items: + type: string + type: array type: object kubernetesVersion: description: 'Optional: Get Kubernetes version, defaults (empty) to retrieving the version from the cluster. Can be manually overridden to a value instead.' @@ -1123,7 +1127,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array @@ -1267,7 +1271,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - groupVersions: + kubernetesGroupVersions: items: type: string type: array diff --git a/pkg/apis/kappctrl/v1alpha1/generated.pb.go b/pkg/apis/kappctrl/v1alpha1/generated.pb.go index d5cc5a990..32b5eb1f7 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.pb.go +++ b/pkg/apis/kappctrl/v1alpha1/generated.pb.go @@ -1011,15 +1011,15 @@ func (m *GenericStatus) XXX_DiscardUnknown() { var xxx_messageInfo_GenericStatus proto.InternalMessageInfo -func (m *GroupVersion) Reset() { *m = GroupVersion{} } -func (*GroupVersion) ProtoMessage() {} -func (*GroupVersion) Descriptor() ([]byte, []int) { +func (m *KubernetesGroupVersions) Reset() { *m = KubernetesGroupVersions{} } +func (*KubernetesGroupVersions) ProtoMessage() {} +func (*KubernetesGroupVersions) Descriptor() ([]byte, []int) { return fileDescriptor_e972ccf085273df7, []int{35} } -func (m *GroupVersion) XXX_Unmarshal(b []byte) error { +func (m *KubernetesGroupVersions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GroupVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *KubernetesGroupVersions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -1027,17 +1027,17 @@ func (m *GroupVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } -func (m *GroupVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupVersion.Merge(m, src) +func (m *KubernetesGroupVersions) XXX_Merge(src proto.Message) { + xxx_messageInfo_KubernetesGroupVersions.Merge(m, src) } -func (m *GroupVersion) XXX_Size() int { +func (m *KubernetesGroupVersions) XXX_Size() int { return m.Size() } -func (m *GroupVersion) XXX_DiscardUnknown() { - xxx_messageInfo_GroupVersion.DiscardUnknown(m) +func (m *KubernetesGroupVersions) XXX_DiscardUnknown() { + xxx_messageInfo_KubernetesGroupVersions.DiscardUnknown(m) } -var xxx_messageInfo_GroupVersion proto.InternalMessageInfo +var xxx_messageInfo_KubernetesGroupVersions proto.InternalMessageInfo func (m *Version) Reset() { *m = Version{} } func (*Version) ProtoMessage() {} @@ -1104,7 +1104,7 @@ func init() { proto.RegisterType((*AppTemplateYtt)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppTemplateYtt") proto.RegisterType((*Condition)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Condition") proto.RegisterType((*GenericStatus)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GenericStatus") - proto.RegisterType((*GroupVersion)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GroupVersion") + proto.RegisterType((*KubernetesGroupVersions)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.KubernetesGroupVersions") proto.RegisterType((*Version)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Version") } @@ -1113,166 +1113,166 @@ func init() { } var fileDescriptor_e972ccf085273df7 = []byte{ - // 2536 bytes of a gzipped FileDescriptorProto + // 2537 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, - 0x15, 0xf6, 0x8a, 0x94, 0x28, 0x3e, 0xfd, 0x58, 0x1e, 0x5b, 0x35, 0xab, 0xd6, 0xa2, 0xb1, 0x01, - 0x02, 0x1b, 0xad, 0x49, 0x58, 0x70, 0x5c, 0xa3, 0x05, 0x0a, 0x88, 0x92, 0x25, 0xcb, 0xb2, 0x6c, - 0x62, 0x28, 0xbb, 0x71, 0xda, 0xc4, 0x59, 0x2d, 0x47, 0xe4, 0x96, 0xcb, 0xdd, 0xed, 0xee, 0x2c, - 0x2d, 0x06, 0x29, 0xd0, 0x3f, 0x14, 0x69, 0x53, 0xb4, 0x46, 0x8b, 0xa6, 0x45, 0x0b, 0xf4, 0x52, - 0xa0, 0xf7, 0xa2, 0x3d, 0xe6, 0x52, 0xf4, 0x62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0x2c, 0xdc, 0x19, 0x98, 0xc7, 0x43, 0x2b, 0xd4, 0x7f, 0x64, 0x79, 0x9a, 0x33, 0xea, - 0x5e, 0x1e, 0xa1, 0x43, 0x90, 0xf8, 0xc6, 0x34, 0x71, 0x84, 0x6f, 0x4c, 0x41, 0x23, 0x2e, 0x73, - 0x58, 0x23, 0x6e, 0xf0, 0xc8, 0xb2, 0xcf, 0xcd, 0x91, 0xfd, 0x46, 0x81, 0x53, 0x2d, 0x7f, 0x8f, - 0xb8, 0x16, 0xa1, 0xc4, 0x93, 0xb5, 0x98, 0x74, 0x00, 0xf8, 0x18, 0xe5, 0x93, 0x9c, 0x2b, 0x8b, - 0xfd, 0x5e, 0xf1, 0xd4, 0xf6, 0x20, 0x20, 0x1e, 0x96, 0x01, 0xfd, 0x5c, 0x81, 0xf9, 0x68, 0x74, - 0xb5, 0xba, 0x15, 0x38, 0x85, 0x34, 0xc4, 0x42, 0xfd, 0x5e, 0x71, 0x7e, 0x3b, 0x81, 0x86, 0x07, - 0xd0, 0xd5, 0x33, 0x80, 0x86, 0xdd, 0x98, 0xba, 0x02, 0x27, 0x07, 0x82, 0xd0, 0xd8, 0x0b, 0xac, - 0x7e, 0x8e, 0x57, 0x32, 0x43, 0xde, 0x59, 0xfd, 0xd3, 0x44, 0x82, 0x19, 0x73, 0x4e, 0xe8, 0x00, - 0x32, 0x4e, 0x23, 0xf8, 0x30, 0xf7, 0x6a, 0x7a, 0xfe, 0xb0, 0xba, 0x59, 0x15, 0xae, 0xa9, 0xba, - 0x59, 0xc5, 0x0c, 0x32, 0xda, 0xc6, 0xc4, 0x21, 0x7e, 0xe8, 0x00, 0x32, 0x5a, 0x23, 0x08, 0xa9, - 0x29, 0x8a, 0xb6, 0xda, 0x90, 0x5e, 0x73, 0xb5, 0x41, 0x30, 0x83, 0x54, 0x3f, 0x50, 0x12, 0x67, - 0x21, 0x89, 0xd0, 0xbb, 0x0a, 0x9c, 0x71, 0x5c, 0xa3, 0xc3, 0x94,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 0x2f, 0x7f, 0xad, + 0xc0, 0xbc, 0x28, 0xd8, 0xf7, 0x34, 0x27, 0x32, 0xd2, 0x67, 0x21, 0x14, 0xbf, 0x3c, 0x1b, 0x31, + 0x6c, 0x9c, 0x90, 0x44, 0x3d, 0x82, 0xf3, 0x63, 0x96, 0xb2, 0xdc, 0xa4, 0x6e, 0xb8, 0x44, 0x67, + 0x71, 0x86, 0xfb, 0x14, 0x11, 0x1e, 0xc3, 0xdc, 0x64, 0x33, 0x3e, 0x89, 0x93, 0xb4, 0x93, 0xe3, + 0xae, 0x7a, 0x05, 0x96, 0x06, 0x6f, 0xd6, 0x31, 0x56, 0x7d, 0x38, 0x03, 0xb9, 0x75, 0xc7, 0xa9, + 0x39, 0x44, 0x47, 0x37, 0x01, 0x79, 0xc4, 0xed, 0x18, 0x3a, 0x59, 0xd7, 0x75, 0xdb, 0xb7, 0xe8, + 0xed, 0x68, 0xed, 0x8a, 0x5c, 0x8b, 0x6a, 0x43, 0x14, 0x78, 0xc4, 0x2a, 0xf4, 0x0e, 0xe4, 0x74, + 0xd1, 0x5d, 0x91, 0x87, 0x73, 0x37, 0x95, 0x4e, 0x90, 0x28, 0xf1, 0xe5, 0x0b, 0x0e, 0x20, 0xd1, + 0x11, 0x4c, 0x1f, 0x32, 0x45, 0xf0, 0xb6, 0xc4, 0xdc, 0x5a, 0x2d, 0x05, 0xc3, 0x88, 0x5c, 0x02, + 0x7f, 0xc5, 0x02, 0x10, 0xfd, 0x48, 0x81, 0x59, 0x4a, 0xda, 0x8e, 0xa9, 0x51, 0x52, 0xc8, 0x72, + 0xf4, 0x13, 0x2e, 0xe8, 0xf6, 0x25, 0xf7, 0xca, 0x92, 0x14, 0x60, 0x36, 0x18, 0xc1, 0x21, 0x32, + 0x7a, 0x07, 0x66, 0xea, 0xbc, 0x29, 0x50, 0x98, 0xe6, 0x32, 0xec, 0xa7, 0xd1, 0xe2, 0x88, 0x12, + 0x5e, 0xf1, 0x8e, 0x25, 0x26, 0x4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d5, 0x53, 0xdf, 0xeb, + 0xaf, 0x2a, 0x8f, 0xfb, 0xab, 0xca, 0x47, 0xfd, 0x55, 0xe5, 0x93, 0xfe, 0xaa, 0xf2, 0x8f, 0xfe, + 0xaa, 0xf2, 0xe8, 0x9f, 0xab, 0xa7, 0x5e, 0x9f, 0x0d, 0x0e, 0xe7, 0x3f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x5a, 0x10, 0x0a, 0x0c, 0x71, 0x2c, 0x00, 0x00, } func (m *AppCluster) Marshal() (dAtA []byte, err error) { @@ -3063,7 +3063,7 @@ func (m *GenericStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GroupVersion) Marshal() (dAtA []byte, err error) { +func (m *KubernetesGroupVersions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3073,21 +3073,21 @@ func (m *GroupVersion) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GroupVersion) MarshalTo(dAtA []byte) (int, error) { +func (m *KubernetesGroupVersions) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GroupVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *KubernetesGroupVersions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.GroupVersions) > 0 { - for iNdEx := len(m.GroupVersions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.GroupVersions[iNdEx]) - copy(dAtA[i:], m.GroupVersions[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.GroupVersions[iNdEx]))) + if len(m.KubernetesGroupVersions) > 0 { + for iNdEx := len(m.KubernetesGroupVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.KubernetesGroupVersions[iNdEx]) + copy(dAtA[i:], m.KubernetesGroupVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KubernetesGroupVersions[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3818,14 +3818,14 @@ func (m *GenericStatus) Size() (n int) { return n } -func (m *GroupVersion) Size() (n int) { +func (m *KubernetesGroupVersions) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.GroupVersions) > 0 { - for _, s := range m.GroupVersions { + if len(m.KubernetesGroupVersions) > 0 { + for _, s := range m.KubernetesGroupVersions { l = len(s) n += 1 + l + sovGenerated(uint64(l)) } @@ -4148,7 +4148,7 @@ func (this *AppTemplateHelmTemplate) String() string { `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `ValuesFrom:` + repeatedStringForValuesFrom + `,`, `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, - `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "Version", "Version", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesGroupVersions", "KubernetesGroupVersions", 1) + `,`, `}`, }, "") return s @@ -4247,7 +4247,7 @@ func (this *AppTemplateValuesDownwardAPIItem) String() string { `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, `KappControllerVersion:` + strings.Replace(this.KappControllerVersion.String(), "Version", "Version", 1) + `,`, - `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "GroupVersion", "GroupVersion", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesGroupVersions", "KubernetesGroupVersions", 1) + `,`, `}`, }, "") return s @@ -4326,12 +4326,12 @@ func (this *GenericStatus) String() string { }, "") return s } -func (this *GroupVersion) String() string { +func (this *KubernetesGroupVersions) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&GroupVersion{`, - `GroupVersions:` + fmt.Sprintf("%v", this.GroupVersions) + `,`, + s := strings.Join([]string{`&KubernetesGroupVersions{`, + `KubernetesGroupVersions:` + fmt.Sprintf("%v", this.KubernetesGroupVersions) + `,`, `}`, }, "") return s @@ -7932,7 +7932,7 @@ func (m *AppTemplateHelmTemplate) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.KubernetesAPIs == nil { - m.KubernetesAPIs = &Version{} + m.KubernetesAPIs = &KubernetesGroupVersions{} } if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -8828,7 +8828,7 @@ func (m *AppTemplateValuesDownwardAPIItem) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.KubernetesAPIs == nil { - m.KubernetesAPIs = &GroupVersion{} + m.KubernetesAPIs = &KubernetesGroupVersions{} } if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -9696,7 +9696,7 @@ func (m *GenericStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *GroupVersion) Unmarshal(dAtA []byte) error { +func (m *KubernetesGroupVersions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9719,15 +9719,15 @@ func (m *GroupVersion) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GroupVersion: wiretype end group for non-group") + return fmt.Errorf("proto: KubernetesGroupVersions: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GroupVersion: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KubernetesGroupVersions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupVersions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field KubernetesGroupVersions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9755,7 +9755,7 @@ func (m *GroupVersion) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.GroupVersions = append(m.GroupVersions, string(dAtA[iNdEx:postIndex])) + m.KubernetesGroupVersions = append(m.KubernetesGroupVersions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/pkg/apis/kappctrl/v1alpha1/generated.proto b/pkg/apis/kappctrl/v1alpha1/generated.proto index 9c826d266..7aed776a3 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.proto +++ b/pkg/apis/kappctrl/v1alpha1/generated.proto @@ -337,7 +337,7 @@ message AppTemplateHelmTemplate { optional Version kubernetesVersion = 5; // Optional: Use kubernetes group/versions resources available in the live cluster - optional Version kubernetesAPIs = 6; + optional KubernetesGroupVersions kubernetesAPIs = 6; } // TODO implement jsonnet @@ -405,7 +405,7 @@ message AppTemplateValuesDownwardAPIItem { // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. // Can be manually supplied instead, e.g ["group/version", "group2/version2"] - optional GroupVersion kubernetesAPIs = 5; + optional KubernetesGroupVersions kubernetesAPIs = 5; } // +k8s:openapi-gen=true @@ -483,8 +483,8 @@ message GenericStatus { } // +k8s:openapi-gen=true -message GroupVersion { - repeated string groupVersions = 1; +message KubernetesGroupVersions { + repeated string kubernetesGroupVersions = 1; } // +k8s:openapi-gen=true diff --git a/pkg/apis/kappctrl/v1alpha1/types_template.go b/pkg/apis/kappctrl/v1alpha1/types_template.go index ae5c70407..9023e0665 100644 --- a/pkg/apis/kappctrl/v1alpha1/types_template.go +++ b/pkg/apis/kappctrl/v1alpha1/types_template.go @@ -57,7 +57,7 @@ type AppTemplateHelmTemplate struct { // Can be manually overridden to a value instead. KubernetesVersion *Version `json:"kubernetesVersion,omitempty" protobuf:"bytes,5,opt,name=kubernetesVersion"` // Optional: Use kubernetes group/versions resources available in the live cluster - KubernetesAPIs *Version `json:"kubernetesAPIs,omitempty" protobuf:"bytes,6,opt,name=kubernetesAPIs"` + KubernetesAPIs *KubernetesGroupVersions `json:"kubernetesAPIs,omitempty" protobuf:"bytes,6,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true @@ -91,7 +91,7 @@ type AppTemplateValuesDownwardAPIItem struct { KappControllerVersion *Version `json:"kappControllerVersion,omitempty" protobuf:"bytes,4,opt,name=kappControllerVersion"` // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. // Can be manually supplied instead, e.g ["group/version", "group2/version2"] - KubernetesAPIs *GroupVersion `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` + KubernetesAPIs *KubernetesGroupVersions `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true @@ -100,8 +100,8 @@ type Version struct { } // +k8s:openapi-gen=true -type GroupVersion struct { - GroupVersions []string `json:"groupVersions,omitempty" protobuf:"bytes,1,opt,name=groupVersions"` +type KubernetesGroupVersions struct { + KubernetesGroupVersions []string `json:"kubernetesGroupVersions,omitempty" protobuf:"bytes,1,opt,name=kubernetesGroupVersions"` } // TODO implement kustomize diff --git a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go index 68ad4749d..ab12016dd 100644 --- a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go @@ -738,8 +738,8 @@ func (in *AppTemplateHelmTemplate) DeepCopyInto(out *AppTemplateHelmTemplate) { } if in.KubernetesAPIs != nil { in, out := &in.KubernetesAPIs, &out.KubernetesAPIs - *out = new(Version) - **out = **in + *out = new(KubernetesGroupVersions) + (*in).DeepCopyInto(*out) } return } @@ -934,7 +934,7 @@ func (in *AppTemplateValuesDownwardAPIItem) DeepCopyInto(out *AppTemplateValuesD } if in.KubernetesAPIs != nil { in, out := &in.KubernetesAPIs, &out.KubernetesAPIs - *out = new(GroupVersion) + *out = new(KubernetesGroupVersions) (*in).DeepCopyInto(*out) } return @@ -1099,39 +1099,39 @@ func (in *GenericStatus) DeepCopy() *GenericStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GroupVersion) DeepCopyInto(out *GroupVersion) { +func (in *KappDeployStatus) DeepCopyInto(out *KappDeployStatus) { *out = *in - if in.GroupVersions != nil { - in, out := &in.GroupVersions, &out.GroupVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } + in.AssociatedResources.DeepCopyInto(&out.AssociatedResources) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupVersion. -func (in *GroupVersion) DeepCopy() *GroupVersion { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KappDeployStatus. +func (in *KappDeployStatus) DeepCopy() *KappDeployStatus { if in == nil { return nil } - out := new(GroupVersion) + out := new(KappDeployStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KappDeployStatus) DeepCopyInto(out *KappDeployStatus) { +func (in *KubernetesGroupVersions) DeepCopyInto(out *KubernetesGroupVersions) { *out = *in - in.AssociatedResources.DeepCopyInto(&out.AssociatedResources) + if in.KubernetesGroupVersions != nil { + in, out := &in.KubernetesGroupVersions, &out.KubernetesGroupVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KappDeployStatus. -func (in *KappDeployStatus) DeepCopy() *KappDeployStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesGroupVersions. +func (in *KubernetesGroupVersions) DeepCopy() *KubernetesGroupVersions { if in == nil { return nil } - out := new(KappDeployStatus) + out := new(KubernetesGroupVersions) in.DeepCopyInto(out) return out } diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index 9fd4ddda0..f25cab86e 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -50,7 +50,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSourceRef": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesSourceRef(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateYtt": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateYtt(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Condition": schema_pkg_apis_kappctrl_v1alpha1_Condition(ref), - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion": schema_pkg_apis_kappctrl_v1alpha1_GroupVersion(ref), + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions": schema_pkg_apis_kappctrl_v1alpha1_KubernetesGroupVersions(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version": schema_pkg_apis_kappctrl_v1alpha1_Version(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.AppTemplateSpec": schema_apiserver_apis_datapackaging_v1alpha1_AppTemplateSpec(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.IncludedSoftware": schema_apiserver_apis_datapackaging_v1alpha1_IncludedSoftware(ref), @@ -1165,14 +1165,14 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateHelmTemplate(ref common.Refere "kubernetesAPIs": { SchemaProps: spec.SchemaProps{ Description: "Optional: Use kubernetes group/versions resources available in the live cluster", - Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"), + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions"), }, }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1381,14 +1381,14 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesDownwardAPIItem(ref comm "kubernetesAPIs": { SchemaProps: spec.SchemaProps{ Description: "Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g [\"group/version\", \"group2/version2\"]", - Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion"), + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions"), }, }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.GroupVersion", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1564,13 +1564,13 @@ func schema_pkg_apis_kappctrl_v1alpha1_Condition(ref common.ReferenceCallback) c } } -func schema_pkg_apis_kappctrl_v1alpha1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_kappctrl_v1alpha1_KubernetesGroupVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "groupVersions": { + "kubernetesGroupVersions": { SchemaProps: spec.SchemaProps{ Type: []string{"array"}, Items: &spec.SchemaOrArray{ diff --git a/pkg/app/app.go b/pkg/app/app.go index 198bb62d1..f69626a3e 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -42,6 +42,9 @@ type App struct { deployFactory deploy.Factory compInfo ComponentInfo + memoizedKubernetesVersion string + memoizedKubernetesAPIs []string + log logr.Logger appMetrics *metrics.AppMetrics diff --git a/pkg/app/app_reconcile_test.go b/pkg/app/app_reconcile_test.go index 3e22f9862..176a56b1c 100644 --- a/pkg/app/app_reconcile_test.go +++ b/pkg/app/app_reconcile_test.go @@ -227,19 +227,25 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing. } type FakeComponentInfo struct { - KCVersion semver.Version - K8sVersion semver.Version - K8sAPIs []string + KCVersion semver.Version + KCVersionCount *int + K8sVersion semver.Version + K8sVersionCount *int + K8sAPIs []string + K8sAPIsCount *int } func (f FakeComponentInfo) KubernetesAPIs() ([]string, error) { + *f.K8sAPIsCount++ return f.K8sAPIs, nil } func (f FakeComponentInfo) KappControllerVersion() (semver.Version, error) { + *f.KCVersionCount++ return f.KCVersion, nil } func (f FakeComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { + *f.K8sVersionCount++ return f.K8sVersion, nil } diff --git a/pkg/app/app_template.go b/pkg/app/app_template.go index 52c5c278d..91b335aa5 100644 --- a/pkg/app/app_template.go +++ b/pkg/app/app_template.go @@ -26,25 +26,7 @@ func (a *App) template(dirPath string) exec.CmdRunResult { var result exec.CmdRunResult var isStream bool - kubernetesVersion, err := a.compInfo.KubernetesVersion(a.app.Spec.ServiceAccountName, a.app.Spec.Cluster, &a.app.ObjectMeta) - if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes version before templating: %s", err)) - return result - } - - kappControllerVersion, err := a.compInfo.KappControllerVersion() - if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to get kapp-controller version before templating: %s", err)) - return result - } - - k8sAPIs, err := a.compInfo.KubernetesAPIs() - if err != nil { - result.AttachErrorf("%s", fmt.Errorf("Unable to list all server apigroups/version before templating: %s", err)) - return result - } - - additionalValues := ctltpl.AdditionalDownwardAPIValues{KubernetesVersion: kubernetesVersion.String(), KappControllerVersion: kappControllerVersion.String(), KubernetesAPIs: k8sAPIs} + additionalValues := a.buildDownwardAPIAdditionalValues() for _, tpl := range a.app.Spec.Template { var template ctltpl.Template @@ -89,3 +71,35 @@ func asPartialObjectMetadata(m v1alpha1.App) ctltpl.PartialObjectMetadata { }, } } + +func (a *App) buildDownwardAPIAdditionalValues() ctltpl.AdditionalDownwardAPIValues { + return ctltpl.AdditionalDownwardAPIValues{ + KubernetesVersion: func() (string, error) { + if a.memoizedKubernetesVersion == "" { + v, err := a.compInfo.KubernetesVersion(a.app.Spec.ServiceAccountName, a.app.Spec.Cluster, &a.app.ObjectMeta) + if err != nil { + return "", fmt.Errorf("Unable to get kubernetes version: %s", err) + } + a.memoizedKubernetesVersion = v.String() + } + return a.memoizedKubernetesVersion, nil + }, + KappControllerVersion: func() (string, error) { + v, err := a.compInfo.KappControllerVersion() + if err != nil { + return "", fmt.Errorf("Unable to get kapp-controller version: %s", err) + } + return v.String(), nil + }, + KubernetesAPIs: func() ([]string, error) { + if len(a.memoizedKubernetesAPIs) == 0 { + v, err := a.compInfo.KubernetesAPIs() + if err != nil { + return []string{}, fmt.Errorf("Unable to list all server apigroups/version: %s", err) + } + a.memoizedKubernetesAPIs = v + } + return a.memoizedKubernetesAPIs, nil + }, + } +} diff --git a/pkg/app/app_template_test.go b/pkg/app/app_template_test.go new file mode 100644 index 000000000..69166d4a7 --- /dev/null +++ b/pkg/app/app_template_test.go @@ -0,0 +1,74 @@ +// Copyright 2022 VMware, Inc. +// SPDX-License-Identifier: Apache-2.0 + +package app + +import ( + "os" + "testing" + + "github.com/k14s/semver/v4" + "github.com/stretchr/testify/assert" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics" + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/template" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sfake "k8s.io/client-go/kubernetes/fake" + logf "sigs.k8s.io/controller-runtime/pkg/log" +) + +func Test_BuildAdditionalDownwardAPIValues_MemoizedCallCount(t *testing.T) { + log := logf.Log.WithName("kc") + + appEmpty := v1alpha1.App{ + ObjectMeta: metav1.ObjectMeta{ + Name: "simple-app", + Namespace: "default", + }, + Spec: v1alpha1.AppSpec{ + Fetch: []v1alpha1.AppFetch{}, + Template: []v1alpha1.AppTemplate{ + {Ytt: &v1alpha1.AppTemplateYtt{ValuesFrom: []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ + {KubernetesVersion: &v1alpha1.Version{}}, + {KappControllerVersion: &v1alpha1.Version{}}, + {KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}}}, + }}}}}, + {Ytt: &v1alpha1.AppTemplateYtt{ValuesFrom: []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ + {KubernetesVersion: &v1alpha1.Version{}}, + {KappControllerVersion: &v1alpha1.Version{}}, + {KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}}}, + }}}}}, + {HelmTemplate: &v1alpha1.AppTemplateHelmTemplate{ + KubernetesVersion: &v1alpha1.Version{}, + KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}, + }}, + }, + }, + } + + k8scs := k8sfake.NewSimpleClientset() + fetchFac := fetch.NewFactory(k8scs, fetch.VendirOpts{}, exec.NewPlainCmdRunner()) + tmpFac := template.NewFactory(k8scs, fetchFac, false, exec.NewPlainCmdRunner()) + deployFac := deploy.NewFactory(k8scs, kubeconfig.NewKubeconfig(k8scs, log), nil, exec.NewPlainCmdRunner(), log) + + k8sVersionCallCount, kcVersionCallCount, k8sAPIsCallCount := 0, 0, 0 + fakeInfo := FakeComponentInfo{K8sVersion: semver.MustParse("1.1.0"), KCVersion: semver.MustParse("2.0.0"), K8sAPIs: []string{"test", "test2"}, + K8sVersionCount: &k8sVersionCallCount, + K8sAPIsCount: &k8sAPIsCallCount, + KCVersionCount: &kcVersionCallCount, + } + app := NewApp(appEmpty, Hooks{}, fetchFac, tmpFac, deployFac, log, metrics.NewAppMetrics(), fakeInfo) + + dir, err := os.MkdirTemp("", "temp") + assert.NoError(t, err) + + app.template(dir) + + assert.Equal(t, 1, k8sVersionCallCount) + assert.Equal(t, 2, kcVersionCallCount) + assert.Equal(t, 1, k8sAPIsCallCount) +} diff --git a/pkg/packageinstall/packageinstall.go b/pkg/packageinstall/packageinstall.go index 0d28d83be..28a7ec50b 100644 --- a/pkg/packageinstall/packageinstall.go +++ b/pkg/packageinstall/packageinstall.go @@ -301,7 +301,18 @@ func (pi *PackageInstallCR) referencedPkgVersion() (datapkgingv1alpha1.Package, // we only need to populate the versionInfo we know that the packages have constraints that will require this info. if requiresClusterVersion { - v, err := pi.compInfo.KubernetesVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta) + kubernetesVersion := func() (semver.Version, error) { + memoizedKubernetesVersion := semver.Version{} + if memoizedKubernetesVersion.Equals(semver.Version{}) { + v, err := pi.compInfo.KubernetesVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta) + if err != nil { + return semver.Version{}, fmt.Errorf("Unable to get kubernetes version: %s", err) + } + memoizedKubernetesVersion = v + } + return memoizedKubernetesVersion, nil + } + v, err := kubernetesVersion() if err != nil { pi.log.Error(err, "Unable to retrieve cluster kubernetes version") return datapkgingv1alpha1.Package{}, err diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 6c45712be..5bd225bbe 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -16,9 +16,9 @@ import ( // AdditionalDownwardAPIValues holds values that are not computed discoverable on the resource itself type AdditionalDownwardAPIValues struct { - KappControllerVersion string - KubernetesVersion string - KubernetesAPIs []string + KappControllerVersion func() (string, error) + KubernetesVersion func() (string, error) + KubernetesAPIs func() ([]string, error) } // DownwardAPIValues produces multiple key-values based on the DownwardAPI config @@ -51,21 +51,33 @@ func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { keyValueContent, err = a.extractFieldPathAsKeyValue(item.Name, fieldPathExpression) case item.KubernetesVersion != nil: if item.KubernetesVersion.Version == "" { // I wish there was a ternary operator in Go - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KubernetesVersion}) + v, err := a.additionalDownwardAPIValues.KubernetesVersion() + if err != nil { + return nil, err + } + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: v}) } else { keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KubernetesVersion.Version}) } case item.KappControllerVersion != nil: if item.KappControllerVersion.Version == "" { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: a.additionalDownwardAPIValues.KappControllerVersion}) + v, err := a.additionalDownwardAPIValues.KappControllerVersion() + if err != nil { + return nil, err + } + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: v}) } else { keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KappControllerVersion.Version}) } case item.KubernetesAPIs != nil: - if item.KubernetesAPIs.GroupVersions == nil { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(a.additionalDownwardAPIValues.KubernetesAPIs, ",")}) + if item.KubernetesAPIs.KubernetesGroupVersions == nil { + v, err := a.additionalDownwardAPIValues.KubernetesAPIs() + if err != nil { + return nil, err + } + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(v, ",")}) } else { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.GroupVersions, ",")}) + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.KubernetesGroupVersions, ",")}) } default: return nil, fmt.Errorf("Invalid downward API item given") diff --git a/pkg/template/helm_template.go b/pkg/template/helm_template.go index 9235f8664..ff406acb4 100644 --- a/pkg/template/helm_template.go +++ b/pkg/template/helm_template.go @@ -76,12 +76,22 @@ func (t *HelmTemplate) template(dirPath string, input io.Reader) exec.CmdRunResu args := []string{"template", name, chartPath, "--namespace", namespace, "--include-crds"} vals := Values{t.opts.ValuesFrom, t.additionalValues, t.appContext, t.coreClient} + var result exec.CmdRunResult if t.opts.KubernetesVersion != nil { - // vals.DownwardAPI.KubernetesVersion() - args = append(args, []string{"--kube-version", vals.AdditionalValues.KubernetesVersion}...) + v, err := vals.AdditionalValues.KubernetesVersion() + if err != nil { + result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes version during helm template: %s", err)) + return result + } + args = append(args, []string{"--kube-version", v}...) } if t.opts.KubernetesAPIs != nil { - args = append(args, []string{"--api-versions", strings.Join(vals.AdditionalValues.KubernetesAPIs, ",")}...) + v, err := vals.AdditionalValues.KubernetesAPIs() + if err != nil { + result.AttachErrorf("%s", fmt.Errorf("Unable to get kubernetes APIs during helm template: %s", err)) + return result + } + args = append(args, []string{"--api-versions", strings.Join(v, ",")}...) } { @@ -112,7 +122,7 @@ func (t *HelmTemplate) template(dirPath string, input io.Reader) exec.CmdRunResu err := t.cmdRunner.Run(cmd) - result := exec.CmdRunResult{ + result = exec.CmdRunResult{ Stdout: stdoutBs.String(), Stderr: stderrBs.String(), } diff --git a/pkg/template/values_test.go b/pkg/template/values_test.go index 61c044866..0b15628aa 100644 --- a/pkg/template/values_test.go +++ b/pkg/template/values_test.go @@ -218,7 +218,9 @@ func TestValues(t *testing.T) { }}, }} subject.AdditionalValues = AdditionalDownwardAPIValues{ - KubernetesVersion: "0.20.0", + KubernetesVersion: func() (string, error) { + return "0.20.0", nil + }, } paths, cleanup, err := subject.AsPaths(os.TempDir()) @@ -237,7 +239,9 @@ func TestValues(t *testing.T) { }}, }} subject.AdditionalValues = AdditionalDownwardAPIValues{ - KappControllerVersion: "0.42.31337", + KappControllerVersion: func() (string, error) { + return "0.42.31337", nil + }, } paths, cleanup, err := subject.AsPaths(os.TempDir()) diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index 2f148297f..56a7c0bfb 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -140,7 +140,7 @@ spec: version: 2.0.0 - name: k8sAPIs kubernetesAPIs: - groupVersions: + kubernetesGroupVersions: - "test/test" - "test2/test2" deploy: @@ -272,7 +272,7 @@ spec: version: 2.0.0 - name: k8sAPIs kubernetesAPIs: - groupVersions: + kubernetesGroupVersions: - "test/test" - "test2/test2" deploy: From 38db77e378d0f9beb0cb5fb544724ff333e7ce90 Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 6 Sep 2022 18:50:08 -0400 Subject: [PATCH 6/8] remove unnecessary memoization - memoizing within packageinstall didnt actually memoize - memoizing within componentinfo was too aggressive so controller would not receive updated version after cluster is updated --- pkg/componentinfo/component_info.go | 20 +++++--------------- pkg/packageinstall/packageinstall.go | 17 ++--------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/pkg/componentinfo/component_info.go b/pkg/componentinfo/component_info.go index d58469900..ac2a7fde3 100644 --- a/pkg/componentinfo/component_info.go +++ b/pkg/componentinfo/component_info.go @@ -16,10 +16,9 @@ import ( // ComponentInfo provides information about components of system type ComponentInfo struct { - coreClient kubernetes.Interface - clusterAccess *kubeconfig.Kubeconfig - kappControllerVersion string - memoizedKubernetesVersion semver.Version + coreClient kubernetes.Interface + clusterAccess *kubeconfig.Kubeconfig + kappControllerVersion string } // NewComponentInfo returns a ComponentInfo @@ -41,22 +40,12 @@ func (ci *ComponentInfo) KappControllerVersion() (semver.Version, error) { func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error) { switch { case len(serviceAccountName) > 0: - if !ci.memoizedKubernetesVersion.Equals(semver.Version{}) { - return ci.memoizedKubernetesVersion, nil - } - v, err := ci.coreClient.Discovery().ServerVersion() if err != nil { return semver.Version{}, err } + return semver.ParseTolerant(v.String()) - version, err := semver.ParseTolerant(v.String()) - if err != nil { - return semver.Version{}, err - } - - ci.memoizedKubernetesVersion = version - return version, nil case specCluster != nil: accessInfo, err := ci.clusterAccess.ClusterAccess(serviceAccountName, specCluster, kubeconfig.AccessLocation{Name: objMeta.Name, Namespace: objMeta.Namespace}) if err != nil { @@ -77,6 +66,7 @@ func (ci *ComponentInfo) KubernetesVersion(serviceAccountName string, specCluste return semver.Version{}, err } return semver.ParseTolerant(v.String()) + default: return semver.Version{}, fmt.Errorf("Expected service account or cluster specified") } diff --git a/pkg/packageinstall/packageinstall.go b/pkg/packageinstall/packageinstall.go index 28a7ec50b..1d0f9f176 100644 --- a/pkg/packageinstall/packageinstall.go +++ b/pkg/packageinstall/packageinstall.go @@ -301,23 +301,10 @@ func (pi *PackageInstallCR) referencedPkgVersion() (datapkgingv1alpha1.Package, // we only need to populate the versionInfo we know that the packages have constraints that will require this info. if requiresClusterVersion { - kubernetesVersion := func() (semver.Version, error) { - memoizedKubernetesVersion := semver.Version{} - if memoizedKubernetesVersion.Equals(semver.Version{}) { - v, err := pi.compInfo.KubernetesVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta) - if err != nil { - return semver.Version{}, fmt.Errorf("Unable to get kubernetes version: %s", err) - } - memoizedKubernetesVersion = v - } - return memoizedKubernetesVersion, nil - } - v, err := kubernetesVersion() + v, err := pi.compInfo.KubernetesVersion(pi.model.Spec.ServiceAccountName, pi.model.Spec.Cluster, &pi.model.ObjectMeta) if err != nil { - pi.log.Error(err, "Unable to retrieve cluster kubernetes version") - return datapkgingv1alpha1.Package{}, err + return datapkgingv1alpha1.Package{}, fmt.Errorf("Unable to get kubernetes version: %s", err) } - v.Pre = semver.PRVersion{} v.Build = semver.BuildMeta{} From 3d9f87f8b964758ee17ffebd2f47d32b2c3d20b2 Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 6 Sep 2022 19:12:38 -0400 Subject: [PATCH 7/8] rename kubernetesGroupVersions to kubernetesAPIs --- config/crds.yml | 16 +- pkg/apis/kappctrl/v1alpha1/generated.pb.go | 388 +++++++++--------- pkg/apis/kappctrl/v1alpha1/generated.proto | 8 +- pkg/apis/kappctrl/v1alpha1/types_template.go | 8 +- .../v1alpha1/zz_generated.deepcopy.go | 16 +- pkg/apiserver/openapi/zz_generated.openapi.go | 14 +- pkg/app/app_template_test.go | 6 +- pkg/template/downward_api_values.go | 4 +- test/e2e/kappcontroller/template_test.go | 2 +- 9 files changed, 231 insertions(+), 231 deletions(-) diff --git a/config/crds.yml b/config/crds.yml index 70defd5eb..5848883c5 100644 --- a/config/crds.yml +++ b/config/crds.yml @@ -436,7 +436,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -468,7 +468,7 @@ spec: kubernetesAPIs: description: 'Optional: Use kubernetes group/versions resources available in the live cluster' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -514,7 +514,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -658,7 +658,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -1049,7 +1049,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -1081,7 +1081,7 @@ spec: kubernetesAPIs: description: 'Optional: Use kubernetes group/versions resources available in the live cluster' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -1127,7 +1127,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array @@ -1271,7 +1271,7 @@ spec: kubernetesAPIs: description: 'Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g ["group/version", "group2/version2"]' properties: - kubernetesGroupVersions: + groupVersions: items: type: string type: array diff --git a/pkg/apis/kappctrl/v1alpha1/generated.pb.go b/pkg/apis/kappctrl/v1alpha1/generated.pb.go index 32b5eb1f7..9730624e5 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.pb.go +++ b/pkg/apis/kappctrl/v1alpha1/generated.pb.go @@ -1011,15 +1011,15 @@ func (m *GenericStatus) XXX_DiscardUnknown() { var xxx_messageInfo_GenericStatus proto.InternalMessageInfo -func (m *KubernetesGroupVersions) Reset() { *m = KubernetesGroupVersions{} } -func (*KubernetesGroupVersions) ProtoMessage() {} -func (*KubernetesGroupVersions) Descriptor() ([]byte, []int) { +func (m *KubernetesAPIs) Reset() { *m = KubernetesAPIs{} } +func (*KubernetesAPIs) ProtoMessage() {} +func (*KubernetesAPIs) Descriptor() ([]byte, []int) { return fileDescriptor_e972ccf085273df7, []int{35} } -func (m *KubernetesGroupVersions) XXX_Unmarshal(b []byte) error { +func (m *KubernetesAPIs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *KubernetesGroupVersions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *KubernetesAPIs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -1027,17 +1027,17 @@ func (m *KubernetesGroupVersions) XXX_Marshal(b []byte, deterministic bool) ([]b } return b[:n], nil } -func (m *KubernetesGroupVersions) XXX_Merge(src proto.Message) { - xxx_messageInfo_KubernetesGroupVersions.Merge(m, src) +func (m *KubernetesAPIs) XXX_Merge(src proto.Message) { + xxx_messageInfo_KubernetesAPIs.Merge(m, src) } -func (m *KubernetesGroupVersions) XXX_Size() int { +func (m *KubernetesAPIs) XXX_Size() int { return m.Size() } -func (m *KubernetesGroupVersions) XXX_DiscardUnknown() { - xxx_messageInfo_KubernetesGroupVersions.DiscardUnknown(m) +func (m *KubernetesAPIs) XXX_DiscardUnknown() { + xxx_messageInfo_KubernetesAPIs.DiscardUnknown(m) } -var xxx_messageInfo_KubernetesGroupVersions proto.InternalMessageInfo +var xxx_messageInfo_KubernetesAPIs proto.InternalMessageInfo func (m *Version) Reset() { *m = Version{} } func (*Version) ProtoMessage() {} @@ -1104,7 +1104,7 @@ func init() { proto.RegisterType((*AppTemplateYtt)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.AppTemplateYtt") proto.RegisterType((*Condition)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Condition") proto.RegisterType((*GenericStatus)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.GenericStatus") - proto.RegisterType((*KubernetesGroupVersions)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.KubernetesGroupVersions") + proto.RegisterType((*KubernetesAPIs)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.KubernetesAPIs") proto.RegisterType((*Version)(nil), "github.com.vmware_tanzu.carvel_kapp_controller.pkg.apis.kappctrl.v1alpha1.Version") } @@ -1113,166 +1113,166 @@ func init() { } var fileDescriptor_e972ccf085273df7 = []byte{ - // 2537 bytes of a gzipped FileDescriptorProto + // 2533 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, - 0xf5, 0xf7, 0x8a, 0x94, 0x28, 0x3e, 0x7d, 0x58, 0x1e, 0x5b, 0x7f, 0xf3, 0xaf, 0x34, 0xa2, 0xb1, - 0x01, 0x82, 0x18, 0xad, 0x49, 0x58, 0x70, 0x0c, 0xa3, 0x05, 0x0a, 0x88, 0x92, 0x25, 0xcb, 0xb2, - 0x6c, 0x62, 0x28, 0xbb, 0x71, 0xda, 0xc4, 0x59, 0x2d, 0x47, 0xe4, 0x96, 0xcb, 0xdd, 0xed, 0xee, - 0x2c, 0x2d, 0x06, 0x29, 0xd0, 0x2f, 0x14, 0x69, 0x53, 0xa0, 0x46, 0x81, 0xa6, 0x45, 0x0b, 0xe4, - 0x52, 0xa0, 0xf7, 0xa2, 0x3d, 0xe6, 0x52, 0xf4, 0x62, 0xa0, 0x97, 0x00, 0x01, 0x8a, 0x9c, 0xd8, - 0x9a, 0x3d, 0xf5, 0x58, 0xe4, 0x96, 0x53, 0x31, 0x1f, 0xfb, 0xc5, 0x0f, 0x53, 0x05, 0xb4, 0x8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e, 0x44, 0x49, 0x70, 0x90, 0xf2, 0x2e, 0x9f, 0x7e, 0x2f, 0x7f, 0xad, - 0xc0, 0xbc, 0x28, 0xd8, 0xf7, 0x34, 0x27, 0x32, 0xd2, 0x67, 0x21, 0x14, 0xbf, 0x3c, 0x1b, 0x31, - 0x6c, 0x9c, 0x90, 0x44, 0x3d, 0x82, 0xf3, 0x63, 0x96, 0xb2, 0xdc, 0xa4, 0x6e, 0xb8, 0x44, 0x67, - 0x71, 0x86, 0xfb, 0x14, 0x11, 0x1e, 0xc3, 0xdc, 0x64, 0x33, 0x3e, 0x89, 0x93, 0xb4, 0x93, 0xe3, - 0xae, 0x7a, 0x05, 0x96, 0x06, 0x6f, 0xd6, 0x31, 0x56, 0x7d, 0x38, 0x03, 0xb9, 0x75, 0xc7, 0xa9, - 0x39, 0x44, 0x47, 0x37, 0x01, 0x79, 0xc4, 0xed, 0x18, 0x3a, 0x59, 0xd7, 0x75, 0xdb, 0xb7, 0xe8, - 0xed, 0x68, 0xed, 0x8a, 0x5c, 0x8b, 0x6a, 0x43, 0x14, 0x78, 0xc4, 0x2a, 0xf4, 0x0e, 0xe4, 0x74, - 0xd1, 0x5d, 0x91, 0x87, 0x73, 0x37, 0x95, 0x4e, 0x90, 0x28, 0xf1, 0xe5, 0x0b, 0x0e, 0x20, 0xd1, - 0x11, 0x4c, 0x1f, 0x32, 0x45, 0xf0, 0xb6, 0xc4, 0xdc, 0x5a, 0x2d, 0x05, 0xc3, 0x88, 0x5c, 0x02, - 0x7f, 0xc5, 0x02, 0x10, 0xfd, 0x48, 0x81, 0x59, 0x4a, 0xda, 0x8e, 0xa9, 0x51, 0x52, 0xc8, 0x72, - 0xf4, 0x13, 0x2e, 0xe8, 0xf6, 0x25, 0xf7, 0xca, 0x92, 0x14, 0x60, 0x36, 0x18, 0xc1, 0x21, 0x32, - 0x7a, 0x07, 0x66, 0xea, 0xbc, 0x29, 0x50, 0x98, 0xe6, 0x32, 0xec, 0xa7, 0xd1, 0x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, 0x1a, 0x86, 0x4b, 0x74, 0x16, + 0x67, 0xb8, 0x4f, 0x11, 0xe1, 0x31, 0xcc, 0x4d, 0x36, 0xe3, 0x83, 0x38, 0xc9, 0x3b, 0x39, 0xee, + 0xaa, 0x97, 0x61, 0x69, 0xf8, 0x66, 0x1d, 0x63, 0xd6, 0xfb, 0x33, 0x90, 0x5b, 0x77, 0x9c, 0x9a, + 0x43, 0x74, 0x74, 0x03, 0x90, 0x47, 0xdc, 0xae, 0xa1, 0x93, 0x75, 0x5d, 0xb7, 0x7d, 0x8b, 0xde, + 0x8a, 0xe6, 0xae, 0xc8, 0xb9, 0xa8, 0x36, 0xc2, 0x81, 0xc7, 0xcc, 0x42, 0x6f, 0x41, 0x4e, 0x17, + 0xdd, 0x15, 0xb9, 0x39, 0x77, 0x52, 0xe9, 0x04, 0x89, 0x12, 0x5f, 0xbe, 0xe0, 0x00, 0x12, 0x1d, + 0xc2, 0xf4, 0x01, 0x33, 0x04, 0x6f, 0x4b, 0xcc, 0xad, 0xd5, 0x52, 0x38, 0x18, 0x91, 0x4b, 0xe0, + 0xaf, 0x58, 0x00, 0xa2, 0x1f, 0x29, 0x30, 0x4b, 0x49, 0xc7, 0x31, 0x35, 0x4a, 0x0a, 0x59, 0x8e, + 0x7e, 0xc2, 0x05, 0xdd, 0xbe, 0x94, 0x5e, 0x59, 0x92, 0x0a, 0xcc, 0x06, 0x14, 0x1c, 0x22, 0xa3, + 0xb7, 0x60, 0xa6, 0xc1, 0x9b, 0x02, 0x85, 0x69, 0xae, 0xc3, 0x7e, 0x1a, 0x2d, 0x8e, 0x28, 0xe1, + 0x15, 0xef, 0x58, 0x62, 0xb2, 0xc4, 0xd8, 0xd1, 0x7c, 0x8f, 0x34, 0x78, 0x05, 0x33, 0x1b, 0xf1, + 0x55, 0x39, 0x15, 0xcb, 0x51, 0xf4, 0x65, 0x98, 0xd5, 0x35, 0x4b, 0x27, 0x26, 0x69, 0xf0, 0x22, + 0x6b, 0x36, 0x5a,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94, 0x5c, + 0x59, 0x1e, 0xf4, 0x8b, 0x67, 0x76, 0x87, 0x01, 0xf1, 0xa8, 0x0e, 0xe8, 0x5d, 0x05, 0x16, 0x23, + 0xea, 0x7a, 0x75, 0x27, 0x70, 0x0a, 0x27, 0x79, 0x37, 0x77, 0x13, 0x00, 0x15, 0x34, 0xe8, 0x17, + 0x17, 0x93, 0x34, 0x3c, 0xa4, 0x84, 0x7a, 0x0e, 0xd0, 0xa8, 0x37, 0x53, 0xd7, 0xe0, 0xf4, 0x50, + 0x2c, 0x9a, 0x78, 0x8f, 0xd5, 0xcf, 0xf1, 0x82, 0x66, 0xc4, 0x49, 0xab, 0xbf, 0x9f, 0x4a, 0x08, + 0x63, 0x3e, 0x0a, 0x1d, 0x42, 0xc6, 0x69, 0x06, 0xdf, 0xe7, 0x5e, 0x4b, 0xcf, 0x2d, 0x56, 0xb7, + 0xab, 0xc2, 0x43, 0x55, 0xb7, 0xab, 0x98, 0x41, 0x46, 0xcb, 0x98, 0x3a, 0xc2, 0x1d, 0x1d, 0x42, + 0x46, 0x6b, 0x06, 0x91, 0x35, 0x45, 0xd5, 0xd6, 0x9b, 0xd2, 0x79, 0xae, 0x37, 0x09, 0x66, 0x90, + 0xea, 0x87, 0x4a, 0x62, 0x2f, 0x24, 0x13, 0x7a, 0x5f, 0x81, 0x73, 0x8e, 0x6b, 0x74, 0x99, 0x51, + 0x49, 0xcf, 0xab, 0x0d, 0xd5, 0x86, 0x56, 0x8a, 0xd6, 0x1b, 0x83, 0x5a, 0x29, 0x0c, 0xfa, 0xc5, + 0x73, 0xe3, 0x46, 0xf0, 0x58, 0x2d, 0xc7, 0xad, 0xaa, 0xba, 0x5d, 0xfd, 0xac, 0xaf, 0x6a, 0x1b, + 0x5e, 0x38, 0x86, 0xd8, 0x63, 0x54, 0x84, 0x7f, 0x50, 0xe0, 0x8b, 0x23, 0xde, 0x6e, 0xd3, 0x7e, + 0x60, 0x3d, 0xd0, 0xdc, 0xc6, 0x7a, 0x75, 0x07, 0x3d, 0x54, 0x60, 0xda, 0xa0, 0xa4, 0x13, 0x74, + 0x60, 0xda, 0x69, 0xba, 0xd9, 0x18, 0xf0, 0x0e, 0x25, 0x9d, 0x58, 0xff, 0x8c, 0x69, 0x80, 0x85, + 0x22, 0xea, 0xdf, 0xb2, 0x70, 0x7e, 0xd2, 0xd4, 0xe3, 0x05, 0xa6, 0x03, 0x83, 0x98, 0x8d, 0x58, + 0x75, 0x1e, 0x06, 0xa6, 0xad, 0x60, 0x00, 0x47, 0x3c, 0x47, 0x78, 0xf7, 0xcc, 0x33, 0xe0, 0xdd, + 0x7f, 0xa7, 0xc0, 0x32, 0x93, 0xb3, 0x11, 0xca, 0x0f, 0xb4, 0xcb, 0xa6, 0xa6, 0xdd, 0xe7, 0x07, + 0xfd, 0xe2, 0xf2, 0xee, 0x38, 0x50, 0x3c, 0x5e, 0x97, 0x71, 0x31, 0x68, 0xfa, 0x59, 0x88, 0x41, + 0xef, 0x24, 0xf3, 0x9b, 0x78, 0xc4, 0x47, 0xbf, 0x18, 0xd3, 0x0e, 0x23, 0xe9, 0x67, 0x1a, 0x4f, + 0xee, 0x88, 0xfd, 0x66, 0x7c, 0x47, 0xec, 0x29, 0xe9, 0x35, 0xa1, 0x29, 0x76, 0x8c, 0xfc, 0xed, + 0xd7, 0x0a, 0xcc, 0x35, 0xa2, 0xfb, 0x2a, 0x0f, 0x69, 0xf3, 0x29, 0x79, 0x96, 0xca, 0xe9, 0x41, + 0xbf, 0x38, 0x17, 0x23, 0xe0, 0xb8, 0x32, 0xea, 0xd7, 0x61, 0xe5, 0xe8, 0xc5, 0x1f, 0xc3, 0xa3, + 0x7e, 0x9c, 0x49, 0xd4, 0x20, 0xf7, 0x28, 0x45, 0x35, 0x58, 0x36, 0x9a, 0x96, 0xed, 0x92, 0x3b, + 0x56, 0xdb, 0xb2, 0x1f, 0x58, 0x1b, 0x76, 0xa7, 0x43, 0x2c, 0x2a, 0x7e, 0xca, 0x99, 0xad, 0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0x0c, 0xce, 0xe4, + 0x51, 0x38, 0x2c, 0x00, 0x00, } func (m *AppCluster) Marshal() (dAtA []byte, err error) { @@ -3063,7 +3063,7 @@ func (m *GenericStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *KubernetesGroupVersions) Marshal() (dAtA []byte, err error) { +func (m *KubernetesAPIs) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3073,21 +3073,21 @@ func (m *KubernetesGroupVersions) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *KubernetesGroupVersions) MarshalTo(dAtA []byte) (int, error) { +func (m *KubernetesAPIs) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *KubernetesGroupVersions) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *KubernetesAPIs) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.KubernetesGroupVersions) > 0 { - for iNdEx := len(m.KubernetesGroupVersions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.KubernetesGroupVersions[iNdEx]) - copy(dAtA[i:], m.KubernetesGroupVersions[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.KubernetesGroupVersions[iNdEx]))) + if len(m.GroupVersions) > 0 { + for iNdEx := len(m.GroupVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GroupVersions[iNdEx]) + copy(dAtA[i:], m.GroupVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GroupVersions[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3818,14 +3818,14 @@ func (m *GenericStatus) Size() (n int) { return n } -func (m *KubernetesGroupVersions) Size() (n int) { +func (m *KubernetesAPIs) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.KubernetesGroupVersions) > 0 { - for _, s := range m.KubernetesGroupVersions { + if len(m.GroupVersions) > 0 { + for _, s := range m.GroupVersions { l = len(s) n += 1 + l + sovGenerated(uint64(l)) } @@ -4148,7 +4148,7 @@ func (this *AppTemplateHelmTemplate) String() string { `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `ValuesFrom:` + repeatedStringForValuesFrom + `,`, `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, - `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesGroupVersions", "KubernetesGroupVersions", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesAPIs", "KubernetesAPIs", 1) + `,`, `}`, }, "") return s @@ -4247,7 +4247,7 @@ func (this *AppTemplateValuesDownwardAPIItem) String() string { `FieldPath:` + fmt.Sprintf("%v", this.FieldPath) + `,`, `KubernetesVersion:` + strings.Replace(this.KubernetesVersion.String(), "Version", "Version", 1) + `,`, `KappControllerVersion:` + strings.Replace(this.KappControllerVersion.String(), "Version", "Version", 1) + `,`, - `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesGroupVersions", "KubernetesGroupVersions", 1) + `,`, + `KubernetesAPIs:` + strings.Replace(this.KubernetesAPIs.String(), "KubernetesAPIs", "KubernetesAPIs", 1) + `,`, `}`, }, "") return s @@ -4326,12 +4326,12 @@ func (this *GenericStatus) String() string { }, "") return s } -func (this *KubernetesGroupVersions) String() string { +func (this *KubernetesAPIs) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&KubernetesGroupVersions{`, - `KubernetesGroupVersions:` + fmt.Sprintf("%v", this.KubernetesGroupVersions) + `,`, + s := strings.Join([]string{`&KubernetesAPIs{`, + `GroupVersions:` + fmt.Sprintf("%v", this.GroupVersions) + `,`, `}`, }, "") return s @@ -7932,7 +7932,7 @@ func (m *AppTemplateHelmTemplate) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.KubernetesAPIs == nil { - m.KubernetesAPIs = &KubernetesGroupVersions{} + m.KubernetesAPIs = &KubernetesAPIs{} } if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -8828,7 +8828,7 @@ func (m *AppTemplateValuesDownwardAPIItem) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.KubernetesAPIs == nil { - m.KubernetesAPIs = &KubernetesGroupVersions{} + m.KubernetesAPIs = &KubernetesAPIs{} } if err := m.KubernetesAPIs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -9696,7 +9696,7 @@ func (m *GenericStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *KubernetesGroupVersions) Unmarshal(dAtA []byte) error { +func (m *KubernetesAPIs) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9719,15 +9719,15 @@ func (m *KubernetesGroupVersions) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KubernetesGroupVersions: wiretype end group for non-group") + return fmt.Errorf("proto: KubernetesAPIs: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KubernetesGroupVersions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KubernetesAPIs: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KubernetesGroupVersions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GroupVersions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9755,7 +9755,7 @@ func (m *KubernetesGroupVersions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.KubernetesGroupVersions = append(m.KubernetesGroupVersions, string(dAtA[iNdEx:postIndex])) + m.GroupVersions = append(m.GroupVersions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/pkg/apis/kappctrl/v1alpha1/generated.proto b/pkg/apis/kappctrl/v1alpha1/generated.proto index 7aed776a3..f607dcd02 100644 --- a/pkg/apis/kappctrl/v1alpha1/generated.proto +++ b/pkg/apis/kappctrl/v1alpha1/generated.proto @@ -337,7 +337,7 @@ message AppTemplateHelmTemplate { optional Version kubernetesVersion = 5; // Optional: Use kubernetes group/versions resources available in the live cluster - optional KubernetesGroupVersions kubernetesAPIs = 6; + optional KubernetesAPIs kubernetesAPIs = 6; } // TODO implement jsonnet @@ -405,7 +405,7 @@ message AppTemplateValuesDownwardAPIItem { // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. // Can be manually supplied instead, e.g ["group/version", "group2/version2"] - optional KubernetesGroupVersions kubernetesAPIs = 5; + optional KubernetesAPIs kubernetesAPIs = 5; } // +k8s:openapi-gen=true @@ -483,8 +483,8 @@ message GenericStatus { } // +k8s:openapi-gen=true -message KubernetesGroupVersions { - repeated string kubernetesGroupVersions = 1; +message KubernetesAPIs { + repeated string groupVersions = 1; } // +k8s:openapi-gen=true diff --git a/pkg/apis/kappctrl/v1alpha1/types_template.go b/pkg/apis/kappctrl/v1alpha1/types_template.go index 9023e0665..1e9470d4d 100644 --- a/pkg/apis/kappctrl/v1alpha1/types_template.go +++ b/pkg/apis/kappctrl/v1alpha1/types_template.go @@ -57,7 +57,7 @@ type AppTemplateHelmTemplate struct { // Can be manually overridden to a value instead. KubernetesVersion *Version `json:"kubernetesVersion,omitempty" protobuf:"bytes,5,opt,name=kubernetesVersion"` // Optional: Use kubernetes group/versions resources available in the live cluster - KubernetesAPIs *KubernetesGroupVersions `json:"kubernetesAPIs,omitempty" protobuf:"bytes,6,opt,name=kubernetesAPIs"` + KubernetesAPIs *KubernetesAPIs `json:"kubernetesAPIs,omitempty" protobuf:"bytes,6,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true @@ -91,7 +91,7 @@ type AppTemplateValuesDownwardAPIItem struct { KappControllerVersion *Version `json:"kappControllerVersion,omitempty" protobuf:"bytes,4,opt,name=kappControllerVersion"` // Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. // Can be manually supplied instead, e.g ["group/version", "group2/version2"] - KubernetesAPIs *KubernetesGroupVersions `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` + KubernetesAPIs *KubernetesAPIs `json:"kubernetesAPIs,omitempty" protobuf:"bytes,5,opt,name=kubernetesAPIs"` } // +k8s:openapi-gen=true @@ -100,8 +100,8 @@ type Version struct { } // +k8s:openapi-gen=true -type KubernetesGroupVersions struct { - KubernetesGroupVersions []string `json:"kubernetesGroupVersions,omitempty" protobuf:"bytes,1,opt,name=kubernetesGroupVersions"` +type KubernetesAPIs struct { + GroupVersions []string `json:"groupVersions,omitempty" protobuf:"bytes,1,opt,name=groupVersions"` } // TODO implement kustomize diff --git a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go index ab12016dd..b51afa929 100644 --- a/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/kappctrl/v1alpha1/zz_generated.deepcopy.go @@ -738,7 +738,7 @@ func (in *AppTemplateHelmTemplate) DeepCopyInto(out *AppTemplateHelmTemplate) { } if in.KubernetesAPIs != nil { in, out := &in.KubernetesAPIs, &out.KubernetesAPIs - *out = new(KubernetesGroupVersions) + *out = new(KubernetesAPIs) (*in).DeepCopyInto(*out) } return @@ -934,7 +934,7 @@ func (in *AppTemplateValuesDownwardAPIItem) DeepCopyInto(out *AppTemplateValuesD } if in.KubernetesAPIs != nil { in, out := &in.KubernetesAPIs, &out.KubernetesAPIs - *out = new(KubernetesGroupVersions) + *out = new(KubernetesAPIs) (*in).DeepCopyInto(*out) } return @@ -1116,22 +1116,22 @@ func (in *KappDeployStatus) DeepCopy() *KappDeployStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesGroupVersions) DeepCopyInto(out *KubernetesGroupVersions) { +func (in *KubernetesAPIs) DeepCopyInto(out *KubernetesAPIs) { *out = *in - if in.KubernetesGroupVersions != nil { - in, out := &in.KubernetesGroupVersions, &out.KubernetesGroupVersions + if in.GroupVersions != nil { + in, out := &in.GroupVersions, &out.GroupVersions *out = make([]string, len(*in)) copy(*out, *in) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesGroupVersions. -func (in *KubernetesGroupVersions) DeepCopy() *KubernetesGroupVersions { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesAPIs. +func (in *KubernetesAPIs) DeepCopy() *KubernetesAPIs { if in == nil { return nil } - out := new(KubernetesGroupVersions) + out := new(KubernetesAPIs) in.DeepCopyInto(out) return out } diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index f25cab86e..3197d0b72 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -50,7 +50,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSourceRef": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesSourceRef(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateYtt": schema_pkg_apis_kappctrl_v1alpha1_AppTemplateYtt(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Condition": schema_pkg_apis_kappctrl_v1alpha1_Condition(ref), - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions": schema_pkg_apis_kappctrl_v1alpha1_KubernetesGroupVersions(ref), + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesAPIs": schema_pkg_apis_kappctrl_v1alpha1_KubernetesAPIs(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version": schema_pkg_apis_kappctrl_v1alpha1_Version(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.AppTemplateSpec": schema_apiserver_apis_datapackaging_v1alpha1_AppTemplateSpec(ref), "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/v1alpha1.IncludedSoftware": schema_apiserver_apis_datapackaging_v1alpha1_IncludedSoftware(ref), @@ -1165,14 +1165,14 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateHelmTemplate(ref common.Refere "kubernetesAPIs": { SchemaProps: spec.SchemaProps{ Description: "Optional: Use kubernetes group/versions resources available in the live cluster", - Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions"), + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesAPIs"), }, }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.AppTemplateValuesSource", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesAPIs", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1381,14 +1381,14 @@ func schema_pkg_apis_kappctrl_v1alpha1_AppTemplateValuesDownwardAPIItem(ref comm "kubernetesAPIs": { SchemaProps: spec.SchemaProps{ Description: "Optional: Get running KubernetesAPIs from cluster, defaults (empty) to retrieving the APIs from the cluster. Can be manually supplied instead, e.g [\"group/version\", \"group2/version2\"]", - Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions"), + Ref: ref("github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesAPIs"), }, }, }, }, }, Dependencies: []string{ - "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesGroupVersions", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, + "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.KubernetesAPIs", "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1.Version"}, } } @@ -1564,13 +1564,13 @@ func schema_pkg_apis_kappctrl_v1alpha1_Condition(ref common.ReferenceCallback) c } } -func schema_pkg_apis_kappctrl_v1alpha1_KubernetesGroupVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_kappctrl_v1alpha1_KubernetesAPIs(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kubernetesGroupVersions": { + "groupVersions": { SchemaProps: spec.SchemaProps{ Type: []string{"array"}, Items: &spec.SchemaOrArray{ diff --git a/pkg/app/app_template_test.go b/pkg/app/app_template_test.go index 69166d4a7..bcc770df9 100644 --- a/pkg/app/app_template_test.go +++ b/pkg/app/app_template_test.go @@ -35,16 +35,16 @@ func Test_BuildAdditionalDownwardAPIValues_MemoizedCallCount(t *testing.T) { {Ytt: &v1alpha1.AppTemplateYtt{ValuesFrom: []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ {KubernetesVersion: &v1alpha1.Version{}}, {KappControllerVersion: &v1alpha1.Version{}}, - {KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}}}, + {KubernetesAPIs: &v1alpha1.KubernetesAPIs{}}}, }}}}}, {Ytt: &v1alpha1.AppTemplateYtt{ValuesFrom: []v1alpha1.AppTemplateValuesSource{{DownwardAPI: &v1alpha1.AppTemplateValuesDownwardAPI{Items: []v1alpha1.AppTemplateValuesDownwardAPIItem{ {KubernetesVersion: &v1alpha1.Version{}}, {KappControllerVersion: &v1alpha1.Version{}}, - {KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}}}, + {KubernetesAPIs: &v1alpha1.KubernetesAPIs{}}}, }}}}}, {HelmTemplate: &v1alpha1.AppTemplateHelmTemplate{ KubernetesVersion: &v1alpha1.Version{}, - KubernetesAPIs: &v1alpha1.KubernetesGroupVersions{}, + KubernetesAPIs: &v1alpha1.KubernetesAPIs{}, }}, }, }, diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 5bd225bbe..1fb5b085f 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -70,14 +70,14 @@ func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { keyValueContent, err = yaml.Marshal(map[string]string{item.Name: item.KappControllerVersion.Version}) } case item.KubernetesAPIs != nil: - if item.KubernetesAPIs.KubernetesGroupVersions == nil { + if item.KubernetesAPIs.GroupVersions == nil { v, err := a.additionalDownwardAPIValues.KubernetesAPIs() if err != nil { return nil, err } keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(v, ",")}) } else { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.KubernetesGroupVersions, ",")}) + keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.GroupVersions, ",")}) } default: return nil, fmt.Errorf("Invalid downward API item given") diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index 56a7c0bfb..d0aa2aa4a 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -140,7 +140,7 @@ spec: version: 2.0.0 - name: k8sAPIs kubernetesAPIs: - kubernetesGroupVersions: + groupVersions: - "test/test" - "test2/test2" deploy: From 59695959b805fb590b5a10118b01ba917e2a106d Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 6 Sep 2022 19:14:48 -0400 Subject: [PATCH 8/8] use array as type of values for kubernetesAPIs --- pkg/template/downward_api_values.go | 4 +- test/e2e/kappcontroller/template_test.go | 57 +++++++++++++++++++----- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/pkg/template/downward_api_values.go b/pkg/template/downward_api_values.go index 1fb5b085f..8b2aeb61c 100644 --- a/pkg/template/downward_api_values.go +++ b/pkg/template/downward_api_values.go @@ -75,9 +75,9 @@ func (a DownwardAPIValues) AsYAMLs() ([][]byte, error) { if err != nil { return nil, err } - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(v, ",")}) + keyValueContent, err = yaml.Marshal(map[string]interface{}{item.Name: v}) } else { - keyValueContent, err = yaml.Marshal(map[string]string{item.Name: strings.Join(item.KubernetesAPIs.GroupVersions, ",")}) + keyValueContent, err = yaml.Marshal(map[string]interface{}{item.Name: item.KubernetesAPIs.GroupVersions}) } default: return nil, fmt.Errorf("Invalid downward API item given") diff --git a/test/e2e/kappcontroller/template_test.go b/test/e2e/kappcontroller/template_test.go index d0aa2aa4a..2a0f3f02c 100644 --- a/test/e2e/kappcontroller/template_test.go +++ b/test/e2e/kappcontroller/template_test.go @@ -198,7 +198,9 @@ allAnnotations: anotherExpectedAnnotation: anotherExpectedAnnotationValue kubernetesVersion: "1.0.0" kcVersion: "2.0.0" -k8sAPIs: "test/test,test2/test2" +k8sAPIs: +- test/test +- test2/test2 `, name, env.Namespace, uid) actual := cm.Data["values"] @@ -240,15 +242,43 @@ spec: cm.cue: | package cm - apiVersion: "v1" - kind: "ConfigMap" - metadata: - name: "cm-result" - data: - value: "cool" + import "encoding/json" + + vals: { + namespace: string + name: string + uid: string + annotation: string + label: string + kubernetesVersion: string + kcVersion: string + k8sAPIs: [...string] + password: string + } + + cm: { + apiVersion: "v1" + kind: "ConfigMap" + metadata: { + name: "cm-result" + } + data: { + value: "cool" + namespace: vals.namespace + name: vals.name + uid: vals.uid + annotation: vals.annotation + label: vals.label + kubernetesVersion: vals.kubernetesVersion + kcVersion: vals.kcVersion + k8sAPIs: json.Marshal(vals.k8sAPIs) + password: vals.password + } + } template: - cue: - inputExpression: "data:" + inputExpression: "vals:" + outputExpression: "cm" valuesFrom: - secretRef: name: secret-values @@ -271,8 +301,8 @@ spec: kappControllerVersion: version: 2.0.0 - name: k8sAPIs - kubernetesAPIs: - kubernetesGroupVersions: + kubernetesAPIs: + groupVersions: - "test/test" - "test2/test2" deploy: @@ -295,7 +325,10 @@ stringData: t.Cleanup(cleanUp) logger.Section("deploy", func() { - kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name}, e2e.RunOpts{StdinReader: strings.NewReader(appYaml)}) + kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name}, e2e.RunOpts{ + StdinReader: strings.NewReader(appYaml), + OnErrKubectl: []string{"get", "app", name, "-oyaml"}, + }) }) logger.Section("check ConfigMap exists", func() { @@ -319,7 +352,7 @@ namespace: "%s" uid: "%s" kubernetesVersion: "1.0.0" kcVersion: "2.0.0" -k8sAPIs: "test/test,test2/test2" +k8sAPIs: "[\"test/test\",\"test2/test2\"]" `, name, env.Namespace, uid) configMapData, err := yaml.Marshal(cm.Data) require.NoError(t, err)