(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func TestHydratorWithKustomize(t *testing.T) { |
| 187 | ctx := Given(t) |
| 188 | ctx.Path("hydrator-kustomize"). |
| 189 | When(). |
| 190 | CreateFromFile(func(app *Application) { |
| 191 | app.Spec.Source = nil |
| 192 | app.Spec.SourceHydrator = &SourceHydrator{ |
| 193 | DrySource: DrySource{ |
| 194 | RepoURL: fixture.RepoURL(fixture.RepoURLTypeFile), |
| 195 | Path: "hydrator-kustomize", |
| 196 | TargetRevision: "HEAD", |
| 197 | Kustomize: &ApplicationSourceKustomize{ |
| 198 | NameSuffix: "-inline", |
| 199 | }, |
| 200 | }, |
| 201 | SyncSource: SyncSource{ |
| 202 | TargetBranch: "env/test", |
| 203 | Path: "hydrator-kustomize-output", |
| 204 | }, |
| 205 | } |
| 206 | }). |
| 207 | Refresh(RefreshTypeNormal). |
| 208 | Then(). |
| 209 | Expect(SyncStatusIs(SyncStatusCodeOutOfSync)). |
| 210 | When(). |
| 211 | Sync(). |
| 212 | Then(). |
| 213 | Expect(OperationPhaseIs(OperationSucceeded)). |
| 214 | Expect(SyncStatusIs(SyncStatusCodeSynced)). |
| 215 | And(func(_ *Application) { |
| 216 | // Verify that the inline kustomize nameSuffix was applied |
| 217 | // kustomization.yaml has namePrefix: kustomize-, and we added nameSuffix: -inline |
| 218 | // So the ConfigMap name should be kustomize-my-map-inline |
| 219 | _, err := fixture.Run("", "kubectl", "-n="+ctx.DeploymentNamespace(), |
| 220 | "get", "configmap", "kustomize-my-map-inline") |
| 221 | require.NoError(t, err) |
| 222 | }) |
| 223 | } |
| 224 | |
| 225 | func TestHydratorWithDirectory(t *testing.T) { |
| 226 | ctx := Given(t) |
nothing calls this directly
no test coverage detected