Skip to content

Commit

Permalink
chore: remove obsolete image pull secret configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Jun 9, 2022
1 parent 2b3314d commit 1bcf751
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.dekorate.WithProject;
import io.dekorate.config.DefaultConfiguration;
import io.dekorate.kubernetes.configurator.ApplyDeployToApplicationConfiguration;
import io.dekorate.kubernetes.configurator.ApplyImagePullSecretConfiguration;
import io.dekorate.project.ApplyProjectInfo;

public class DefaultKnativeConfigGenerator implements KnativeConfigGenerator, WithProject {
Expand All @@ -29,7 +28,6 @@ public class DefaultKnativeConfigGenerator implements KnativeConfigGenerator, Wi
public DefaultKnativeConfigGenerator(ConfigurationRegistry configurationRegistry) {
this.configurationRegistry = configurationRegistry;
on(new DefaultConfiguration<KnativeConfig>(KnativeConfig.newKnativeConfigBuilderFromDefaults()));
this.configurationRegistry.add(new ApplyImagePullSecretConfiguration());
this.configurationRegistry.add(new ApplyProjectInfo(getProject()));
this.configurationRegistry.add(new ApplyDeployToApplicationConfiguration());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.dekorate.ConfigurationRegistry;
import io.dekorate.config.DefaultConfiguration;
import io.dekorate.kubernetes.configurator.ApplyDeployToApplicationConfiguration;
import io.dekorate.kubernetes.configurator.ApplyImagePullSecretConfiguration;
import io.dekorate.kubernetes.configurator.PopulateWebPort;
import io.dekorate.project.ApplyProjectInfo;

Expand All @@ -29,7 +28,6 @@ public class DefaultKubernetesConfigGenerator implements KubernetesConfigGenerat
public DefaultKubernetesConfigGenerator(ConfigurationRegistry configurationRegistry) {
this.configurationRegistry = configurationRegistry;
this.configurationRegistry.add(new ApplyProjectInfo(getProject()));
this.configurationRegistry.add(new ApplyImagePullSecretConfiguration());
this.configurationRegistry.add(new PopulateWebPort());
this.configurationRegistry.add(new ApplyDeployToApplicationConfiguration());
add(new DefaultConfiguration<KubernetesConfig>(KubernetesConfig.newKubernetesConfigBuilderFromDefaults()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.dekorate.WithProject;
import io.dekorate.config.DefaultConfiguration;
import io.dekorate.kubernetes.configurator.ApplyDeployToApplicationConfiguration;
import io.dekorate.kubernetes.configurator.ApplyImagePullSecretConfiguration;
import io.dekorate.kubernetes.configurator.PopulateWebPort;
import io.dekorate.project.ApplyProjectInfo;

Expand All @@ -31,7 +30,6 @@ public DefaultOpenshiftConfigGenerator(ConfigurationRegistry configurationRegist
this.configurationRegistry = configurationRegistry;
on(new DefaultConfiguration<OpenshiftConfig>(OpenshiftConfig.newOpenshiftConfigBuilderFromDefaults()));

this.configurationRegistry.add(new ApplyImagePullSecretConfiguration());
this.configurationRegistry.add(new ApplyProjectInfo(getProject()));
this.configurationRegistry.add(new PopulateWebPort());
this.configurationRegistry.add(new ApplyDeployToApplicationConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class TektonManifestGenerator implements ManifestGenerator<TektonConfig>,
private static final String DASH = "-";

private static final String MAVEN_LOCAL_REPO_SYS_PROPERTY = "-Dmaven.repo.local=%s";
private static final String IMAGE_PULL_SECRETS_SYS_PROPERTY = "-Ddekorate.image-pull-secrets=";
private static final String IMAGE_PULL_SECRETS_SYS_PROPERTY = "-Ddekorate.%s.image-pull-secrets=";
private static final String USER_NAME_SYS_PROP = "-Duser.name=";

private static final String TEKTON = "tekton";
Expand Down Expand Up @@ -324,7 +324,7 @@ public void generateCommon(String group, TektonConfig config, ImageConfiguration
resourceRegistry.decorate(group,
new AddSecretToServiceAccountDecorator(generatedServiceAccount, config.getImagePushSecret()));
resourceRegistry.decorate(group, new AddToArgsDecorator(projectBuildTaskName, projectBuildStepName,
IMAGE_PULL_SECRETS_SYS_PROPERTY + config.getImagePushSecret()));
String.format(IMAGE_PULL_SECRETS_SYS_PROPERTY, group) + config.getImagePushSecret()));
} else if (config.isUseLocalDockerConfigJson()) {
String generatedSecret = config.getName() + "-registry-credentials";
Path dockerConfigJson = Paths.get(System.getProperty("user.home"), ".docker", "config.json");
Expand All @@ -336,15 +336,15 @@ public void generateCommon(String group, TektonConfig config, ImageConfiguration
+ " is going to be added as part of Secret: " + generatedSecret);
}
resourceRegistry.decorate(group, new AddToArgsDecorator(projectBuildTaskName, projectBuildStepName,
IMAGE_PULL_SECRETS_SYS_PROPERTY + generatedSecret));
String.format(IMAGE_PULL_SECRETS_SYS_PROPERTY, group) + generatedSecret));
resourceRegistry.decorate(group,
new AddDockerConfigJsonSecretDecorator(generatedSecret, dockerConfigJson, annotations));
resourceRegistry.decorate(group, new AddSecretToServiceAccountDecorator(generatedServiceAccount, generatedSecret));
} else if (Strings.isNotNullOrEmpty(config.getRegistryUsername())
&& Strings.isNotNullOrEmpty(config.getRegistryPassword())) {
String generatedSecret = config.getName() + "-registry-credentials";
resourceRegistry.decorate(group, new AddToArgsDecorator(projectBuildTaskName, projectBuildStepName,
IMAGE_PULL_SECRETS_SYS_PROPERTY + generatedSecret));
String.format(IMAGE_PULL_SECRETS_SYS_PROPERTY, group) + generatedSecret));
resourceRegistry.decorate(group, new AddDockerConfigJsonSecretDecorator(generatedSecret, config.getRegistry(),
config.getRegistryUsername(), config.getRegistryPassword(), annotations));
resourceRegistry.decorate(group, new AddSecretToServiceAccountDecorator(generatedServiceAccount, generatedSecret));
Expand Down

This file was deleted.

0 comments on commit 1bcf751

Please sign in to comment.